Skip to content

Commit

Permalink
Floor final font size
Browse files Browse the repository at this point in the history
Flooring the final font size so the browser doesn't round it up breaking the text out of the container.
  • Loading branch information
Robin Franken committed Feb 13, 2017
1 parent 93e258b commit ae2dc25
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function optimalFontSize(wordRatios: number[], maxWidth: number, maxHeight: numb
high = fontSize;
}
}
return low;
return Math.floor(low);
}

function checkConstraints(fontSize: number, wordRatios: number[], maxWidth: number, maxHeight: number, lineHeightRatio: number) {
Expand Down

0 comments on commit ae2dc25

Please sign in to comment.