Skip to content

Commit

Permalink
Magic number no longer needed it seems since Math.floor introduced
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickmarabeas committed Jan 17, 2016
1 parent 0169b57 commit 6ff5872
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/ng-FitText.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,14 @@

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

function resizer() {
Expand Down

0 comments on commit 6ff5872

Please sign in to comment.