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
The Scene's resize() method allows the caller to recompute the offset and the underlying canvas element's dimensions after the canvas DOM size has been changed. If resize() is not called, then the canvas element's dimensions will often have a different aspect ratio from the DOM size and cause the rendered visualization to appear stretched or squished.
The resize() method takes an optional fixed canvas point. This point specifies the pixel location to keep fixed after the aspect ratio transformation. By default, the fixed canvas point used will be the center point of the canvas. Using scene.offset as the fixed point should have the effect of preserving the location of the world origin (0,0).
There is a bug where one or both of the offset components may be a pixel off after the resize(). If calls to resize() are repeated, this can cause the offset to creep in one direction or the other. This seems to occur more readily when the devicePixelRatio is 1.
Develop an example which consistently produces this behavior, then fix it.
The text was updated successfully, but these errors were encountered:
The Scene's
resize()
method allows the caller to recompute theoffset
and the underlying canvas element's dimensions after the canvas DOM size has been changed. Ifresize()
is not called, then the canvas element's dimensions will often have a different aspect ratio from the DOM size and cause the rendered visualization to appear stretched or squished.The
resize()
method takes an optional fixed canvas point. This point specifies the pixel location to keep fixed after the aspect ratio transformation. By default, the fixed canvas point used will be the center point of the canvas. Usingscene.offset
as the fixed point should have the effect of preserving the location of the world origin (0,0).There is a bug where one or both of the
offset
components may be a pixel off after theresize()
. If calls toresize()
are repeated, this can cause the offset to creep in one direction or the other. This seems to occur more readily when thedevicePixelRatio
is 1.Develop an example which consistently produces this behavior, then fix it.
The text was updated successfully, but these errors were encountered: