godot icon indicating copy to clipboard operation
godot copied to clipboard

Fix get_parent_anchorable_rect() not returning the correct size in some cases

Open MinusKube opened this issue 2 years ago • 3 comments

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 avatar Jan 27 '23 20:01 MinusKube

CC @Sauermann

akien-mga avatar Jan 27 '23 20:01 akien-mga

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.

Sauermann avatar Jan 28 '23 02:01 Sauermann

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

MinusKube avatar Jan 28 '23 19:01 MinusKube

Thanks!

YuriSizov avatar Feb 06 '23 13:02 YuriSizov