ng-FitText.js icon indicating copy to clipboard operation
ng-FitText.js copied to clipboard

Parent padding should be excluded

Open jchaney01 opened this issue 9 years ago • 3 comments

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,

jchaney01 avatar May 27 '16 20:05 jchaney01

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

helarqjsc avatar Mar 01 '17 11:03 helarqjsc

Please confirm v4.2.3 fixes issue as expected

patrickmarabeas avatar Mar 03 '17 01:03 patrickmarabeas

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

haxxxton avatar Jun 23 '17 00:06 haxxxton