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
(Included for anyone reading this facing the same issue)
(This needs to go in a resize event, not a scale factor changed event, since winit changes the canvas style after I handle that event, but before I handle the resize event)
However, this is clearly a hack, and I am wondering if there's an existing method to do this correctly, and if not, this issue can be interpreted as a request for such a method.
The text was updated successfully, but these errors were encountered:
I have my canvas's size change automatically using css with a
width: 100%; height: 100%
style that's applied to the canvas on creation.I then watch for changes to the canvas's actual size with a
ResizeObserver
, quite similar to what's done here: https://github.com/BVE-Reborn/rend3/blob/trunk/rend3-framework/src/resize_observer.rsHowever, when dpi gets changed, winit will change the styling of the canvas element to no longer be my
width: 100%; height: 100%
.I mitigate this using the following code placed in my handler for a winit size changed event:
(Included for anyone reading this facing the same issue)
(This needs to go in a resize event, not a scale factor changed event, since winit changes the canvas style after I handle that event, but before I handle the resize event)
However, this is clearly a hack, and I am wondering if there's an existing method to do this correctly, and if not, this issue can be interpreted as a request for such a method.
The text was updated successfully, but these errors were encountered: