units icon indicating copy to clipboard operation
units copied to clipboard

offsetWidth and offsetHeight as fourth argument

Open vitorinoninja opened this issue 7 years ago • 0 comments

Hello! Thank you for your module.

I noticed useSelf was false when using those properties as fourth argument:

units.convert("px", "10%", myElement, "offsetWidth")

This was generating wrong results, since the parent offsetWidth can be different (if myElement as visible scroll, in exemple).

At least in all scenarios I am using, this fix made things work properly. It was fun to read your code and I hope my little change helps somehow!

vitorinoninja avatar Feb 15 '18 18:02 vitorinoninja