Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

consider not rounding dimensions in onResize method #67

Open
dougbacelar opened this issue Sep 23, 2021 · 0 comments
Open

consider not rounding dimensions in onResize method #67

dougbacelar opened this issue Sep 23, 2021 · 0 comments

Comments

@dougbacelar
Copy link

dougbacelar commented Sep 23, 2021

The onResize method in dom.js currently uses offsetWidth and offsetHeight to get the elements dimensions.

These two attributes always return integer values--disregarding the fractional part

As some elements can have subpixel values, perhaps its worth it considering not to round the width and height to achieve a better precision.

I believe this is also causing the zoid library to sometimes generate slightly wrong iframe sizes, since the method seems to be used here

  • this can cause scrollbars to appear in the iframes if the dimensions generated are smaller than the element dimensions

In case you are interested, I opened a draft PR with a suggested approach:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant