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

Use of offsetWidth and offsetHeight induces scroll bars #113

Open
RyanMullins opened this issue Nov 28, 2022 · 0 comments
Open

Use of offsetWidth and offsetHeight induces scroll bars #113

RyanMullins opened this issue Nov 28, 2022 · 0 comments

Comments

@RyanMullins
Copy link
Member

While exploring an unrelated bug, I noticed that ScatterGL uses offsetWidth and offsetHeight properties of its container to set the size of the canvas it renders into.

As the offsetWidth and offsetHeight return the integer values, this can induce horizontal and/or vertical scroll bars in containers if one dimension is not an integer. See the following screenshot from LIT.

One solution is to take the floor of the width and height from getBoundingClientRect() so that it's guaranteed to be at most 1px smaller in each dimension, thereby avoiding scroll bars. Another solution is to support float values for canvas dimesions.

@RyanMullins RyanMullins changed the title Use of Math.ceil() induces scroll bars Use of offsetWidth and offsetHeight induces scroll bars Nov 28, 2022
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

No branches or pull requests

1 participant