ftlabs / ftellipsis

Multi-line ellipsis made possible
MIT License
486 stars 36 forks source link

Changed line height parsing method for subpixel calculations #15

Open anthon opened 2 years ago

anthon commented 2 years ago

As subpixel rendering has become prevalent, ftellipsis is starting to quite often fail to expand clipped elements to the correct height, as the getLineHeight func is using straight parseInt to parse the computed line height.

A way to get around this would be to simply switch to parseFloat. Or do you see a problem with that? Is there a reason for rounding the line height at this initial read state?