Skip to content

Commit

Permalink
Round font sizes down
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickmarabeas committed Jan 17, 2016
1 parent 3a86573 commit 4666e52
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ng-FitText.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@

function calculate() {
var ratio = element[0].offsetHeight / element[0].offsetWidth / newlines;
return Math.max(
return Math.floor(Math.max(
Math.min((parent[0].offsetWidth - 6) * ratio * compressor,
parseFloat(maxFontSize)
),
parseFloat(minFontSize)
)
))
}

function resizer() {
Expand Down

0 comments on commit 4666e52

Please sign in to comment.