patrickmarabeas / ng-FitText.js

An AngularJS directive for inflating web type.
http://patrickmarabeas.github.io/ng-FitText.js
MIT License
222 stars 61 forks source link

Parent padding should be excluded #53

Open jchaney01 opened 8 years ago

jchaney01 commented 8 years ago

If the directive is wrapped inside an element with padding, it appears this is not being considered. The result is that the text is sized as if this padding was not there.

A solution could be changing:

Math.min((parent[0].offsetWidth - 6) * ratio * compressor,

to

Math.min(((parent[0].offsetWidth - (parseFloat(getComputedStyle(parent[0]).paddingLeft) + parseFloat(getComputedStyle(parent[0]).paddingRight))) - 6) * ratio * compressor,
helarqjsc commented 7 years ago

Is there any reason why this change still isn't added to the repository?

patrickmarabeas commented 7 years ago

Please confirm v4.2.3 fixes issue as expected

haxxxton commented 7 years ago

A solution to this issue is likely to also solve #18