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 canvas currently only resizes when the complete window resizes, not when the canvas itself changes size. This works for the example, in which the canvas is a fullscreen background, but for cases when the canvas can resize without the window resizing it results in stretched images.
It appears someone already had something in mind:
There is a "resize" prop on the canvas, which accepts an react-use-measure Options object. These options are then completely ignored, as the react-use-measure library appears to never be used anywhere, except for importing this Options type. All resizing is actually just handled by a this a window.addEventListener('resize', handleResize).
In the meantime, for anyone encountering the issue, you can fix the behaviour without changing the library by writing using your own preferred resize observer on your Canvas and then sending the following message to your worker:
The canvas currently only resizes when the complete window resizes, not when the canvas itself changes size. This works for the example, in which the canvas is a fullscreen background, but for cases when the canvas can resize without the window resizing it results in stretched images.
It appears someone already had something in mind:
There is a "resize" prop on the canvas, which accepts an
react-use-measure
Options object. These options are then completely ignored, as thereact-use-measure
library appears to never be used anywhere, except for importing this Options type. All resizing is actually just handled by a this awindow.addEventListener('resize', handleResize)
.In the meantime, for anyone encountering the issue, you can fix the behaviour without changing the library by writing using your own preferred resize observer on your Canvas and then sending the following message to your worker:
The text was updated successfully, but these errors were encountered: