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

Fix wrong viewport scaling at intermediate resolutions #102741

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KerekesDavid
Copy link

@KerekesDavid KerekesDavid commented Feb 12, 2025

Fixes #102656: viewport scale is wrong at resolutions that are not integer multiples of content_scale_factor.

This is done by allowing size_2d_override to be Size2 instead of Size2i. This change is propagated to keep the exposed SubViewport consistent with the underlying implementation. Looking for feedback on whether exposing this in a fix is preferred or not.

Note:
I see the output of Viewport::get_visible_rect() get treated as a Rect2i in some places, even though it returns a Rect2. Before this change, this might have been accidentally correct, since it was generated from either size or size_2d_override, which were both Size2i. It might need a second look to make sure it still works correctly, because I'm not exactly sure what all these code fragments do.

Fixes viewport scale being wrong at resolutions that are not
integer multiples of content_scale_factor.

This is done by allowing size_2d_override to be Size2 instead of
Size2i. This change is propagated to keep the exposed SubViewport
consistent with the underlying implementation.
@KerekesDavid KerekesDavid requested review from a team as code owners February 12, 2025 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Window content_scale_factor causes jitter in Control size
1 participant