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 get_parent_anchorable_rect() not returning the correct size in some cases #72204

Merged
merged 1 commit into from
Feb 6, 2023

Conversation

MinusKube
Copy link
Contributor

Fixes #67303

When a control is at the top-level of a subviewport (e.g. in a Window or in a SubviewportContainer), it was considered as if it was at the top-level of the edited scene viewport, thus the parent anchorable rect was computed using the viewport_width and viewport_height properties, instead of using the real subviewport size.

@MinusKube MinusKube requested a review from a team as a code owner January 27, 2023 20:10
@akien-mga akien-mga added this to the 4.0 milestone Jan 27, 2023
@akien-mga
Copy link
Member

CC @Sauermann

@Sauermann
Copy link
Contributor

I have tested the PR and it fixes the MRP of the linked issue.

However a special case is not taken into consideration:

  1. Take the MRP of the linked issue
  2. In the SceneTree make Window to scene-root

These steps result in the following SceneTree:

  • Window
    • TextureRect

In this case the TextureRect is again not displayed correctly.

@MinusKube MinusKube force-pushed the anchorable_rect_editor_bug branch from 9dc8fe3 to 0f512a6 Compare January 28, 2023 19:09
@MinusKube
Copy link
Contributor Author

Okay, fixed! Now I compare the current viewport to the edited scene root's parent viewport instead of the root viewport directly.

Copy link
Contributor

@Sauermann Sauermann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested the latest changes and they work.
Changes looking good to me.

@YuriSizov YuriSizov merged commit 9d3b4b0 into godotengine:master Feb 6, 2023
@YuriSizov
Copy link
Contributor

Thanks!

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.

Control node visuals not resizing correctly to Window node in editor
4 participants