Skip to content

Commit f3454b0

Browse files
Integrate #53 fix for parent padding
1 parent b430db6 commit f3454b0

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ngFitText",
3-
"version": "4.2.2",
3+
"version": "4.2.3",
44
"main": [
55
"dist/ng-FitText.min.js"
66
],

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ng-fittext",
3-
"version": "4.2.2",
3+
"version": "4.2.3",
44
"description": "An AngularJS directive for inflating web type",
55
"homepage": "https://github.com/patrickmarabeas/ng-FitText.js",
66
"bugs": "https://github.com/patrickmarabeas/ng-FitText.js/issues",

src/ng-FitText.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* ng-FitText.js v4.2.2
2+
* ng-FitText.js v4.2.3
33
* https://github.com/patrickmarabeas/ng-FitText.js
44
*
55
* Original jQuery project: https://github.com/davatron5000/FitText.js
@@ -58,7 +58,7 @@
5858
function calculate() {
5959
var ratio = (calcSize * newlines) / domElem.offsetWidth / newlines;
6060
return Math.max(
61-
Math.min((parent[0].offsetWidth - 6) * ratio * compressor,
61+
Math.min(((parent[0].offsetWidth - (parseFloat(getComputedStyle(parent[0]).paddingLeft) + parseFloat(getComputedStyle(parent[0]).paddingRight))) - 6) * ratio * compressor,
6262
parseFloat(maxFontSize)
6363
),
6464
parseFloat(minFontSize)

0 commit comments

Comments
 (0)