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 Window/wrap_controls does not account for the content_scale_factor #91971

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

Conversation

Delsin-Yu
Copy link
Contributor

@Delsin-Yu Delsin-Yu commented May 15, 2024

Previously

wrap_controls allows a window to self-determine its best minimum size for displaying its children Controls, however, such calculation forgot to include the content_scale_factor, which leads the window too big (if the scale factor is less than one) or too small (if the scale factor is larger than one) for its content_scale_factor applied children.

QQ2024515-52755.mp4

In this PR

I multiplied the results of the Window::_get_contents_minimum_size() with content_scale_factor, which results in the correct size.

QQ2024515-152828.mp4

Closes #91960

@Delsin-Yu Delsin-Yu requested a review from a team as a code owner May 15, 2024 07:30
@akien-mga
Copy link
Member

Please amend the commit message to be explicit. See https://github.com/godotengine/godot/blob/master/CONTRIBUTING.md#be-mindful-of-your-commits

@Delsin-Yu Delsin-Yu force-pushed the WrapControls_ContentScaleFactor branch from bbf927a to b7fca0a Compare May 15, 2024 07:54
@Delsin-Yu
Copy link
Contributor Author

Please amend the commit message to be explicit. See https://github.com/godotengine/godot/blob/master/CONTRIBUTING.md#be-mindful-of-your-commits

Done.

@Sauermann Sauermann self-requested a review May 15, 2024 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UI: Window/wrap_controls does not account for the content_scale_factor
3 participants