diff --git a/bower.json b/bower.json index f4276b1..456407f 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "ngFitText", - "version": "4.2.2", + "version": "4.2.3", "main": [ "dist/ng-FitText.min.js" ], diff --git a/package.json b/package.json index e1cfd5d..f0bc891 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ng-fittext", - "version": "4.2.2", + "version": "4.2.3", "description": "An AngularJS directive for inflating web type", "homepage": "https://github.com/patrickmarabeas/ng-FitText.js", "bugs": "https://github.com/patrickmarabeas/ng-FitText.js/issues", diff --git a/src/ng-FitText.js b/src/ng-FitText.js index abe6fbd..a4ef304 100644 --- a/src/ng-FitText.js +++ b/src/ng-FitText.js @@ -1,5 +1,5 @@ /** - * ng-FitText.js v4.2.2 + * ng-FitText.js v4.2.3 * https://github.com/patrickmarabeas/ng-FitText.js * * Original jQuery project: https://github.com/davatron5000/FitText.js @@ -58,7 +58,7 @@ function calculate() { var ratio = (calcSize * newlines) / domElem.offsetWidth / newlines; return Math.max( - Math.min((parent[0].offsetWidth - 6) * ratio * compressor, + Math.min(((parent[0].offsetWidth - (parseFloat(getComputedStyle(parent[0]).paddingLeft) + parseFloat(getComputedStyle(parent[0]).paddingRight))) - 6) * ratio * compressor, parseFloat(maxFontSize) ), parseFloat(minFontSize)