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

On Web, don't scale the canvas on scale factor changes #2864

Closed
daxpedda opened this issue Jun 9, 2023 · 0 comments · Fixed by #2859
Closed

On Web, don't scale the canvas on scale factor changes #2864

daxpedda opened this issue Jun 9, 2023 · 0 comments · Fixed by #2859
Assignees
Labels
C - needs discussion Direction must be ironed out DS - web S - enhancement Wouldn't this be the coolest?

Comments

@daxpedda
Copy link
Member

daxpedda commented Jun 9, 2023

The documentation says about WindowEvent::ScaleFactorChanged::new_inner_size:

By default, this will contain the size suggested by the OS, but it can be changed to any value.

This isn't really possible on Web, because the Web doesn't suggest anything. After some IRC discussion we established that to be consistent with other backends, we should do whats usually "expected" here and scale the canvas with the scale factor, which is how it works currently anyway.

But this is often not desirable, because users usually want to control the size of the canvas through CSS and don't want Winit to overwrite it, which will be made possible by #2859. But changing the scale factor, will currently by default overwrite the any user defined CSS values, unless the user changes WindowEvent::ScaleFactorChanged::new_inner_size back to it's old value, which was taken into account by #2860.

I'm suggesting we should lean into the "suggested by the OS" argument, which in this case would be whatever CSS says is the new value, not overwriting any values set through CSS by default.

@daxpedda daxpedda added S - enhancement Wouldn't this be the coolest? DS - web C - needs discussion Direction must be ironed out labels Jun 9, 2023
@daxpedda daxpedda self-assigned this Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C - needs discussion Direction must be ironed out DS - web S - enhancement Wouldn't this be the coolest?
Development

Successfully merging a pull request may close this issue.

1 participant