ng-FitText.js
ng-FitText.js copied to clipboard
Parent padding should be excluded
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,
Is there any reason why this change still isn't added to the repository?
Please confirm v4.2.3 fixes issue as expected
A solution to this issue is likely to also solve #18