ember-table icon indicating copy to clipboard operation
ember-table copied to clipboard

Refactor offsetHeight use float-compat API

Open mixonic opened this issue 3 years ago • 0 comments

offsetHeight, per MDN, is an API which returns integer values. This makes is inappropriate to use in calculations of current UI scale (usually from a transform) as it rounds any floating point height into an integer.

This PR changes the getScale function to use getComputedStyle to read off the logical height of the element. This API supports greater precision (to at least 3 digits) though it also may not provide the same level of precision as getBoundingClientRect.

This prevents the positioning data for cells (which is impacted by scale) from being corrupted by heights which are at decimal precision.

mixonic avatar May 03 '22 20:05 mixonic