You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
RyanMullins
changed the title
Use of Math.ceil() induces scroll bars
Use of offsetWidth and offsetHeight induces scroll bars
Nov 28, 2022
While exploring an unrelated bug, I noticed that ScatterGL uses
offsetWidth
andoffsetHeight
properties of itscontainer
to set the size of the canvas it renders into.As the
offsetWidth
andoffsetHeight
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
andheight
fromgetBoundingClientRect()
so that it's guaranteed to be at most1px
smaller in each dimension, thereby avoiding scroll bars. Another solution is to supportfloat
values for canvas dimesions.The text was updated successfully, but these errors were encountered: