Fix get_parent_anchorable_rect() not returning the correct size in some cases
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.
CC @Sauermann
I have tested the PR and it fixes the MRP of the linked issue.
However a special case is not taken into consideration:
- Take the MRP of the linked issue
- In the SceneTree make
Windowto scene-root
These steps result in the following SceneTree:
- Window
- TextureRect
In this case the TextureRect is again not displayed correctly.
Okay, fixed! Now I compare the current viewport to the edited scene root's parent viewport instead of the root viewport directly.
Thanks!