Merge pull request #72204 from MinusKube/anchorable_rect_editor_bug
Fix get_parent_anchorable_rect() not returning the correct size in some cases
This commit is contained in:
commit
9d3b4b0b40
@ -644,8 +644,10 @@ Rect2 Control::get_parent_anchorable_rect() const {
|
||||
parent_rect = data.parent_canvas_item->get_anchorable_rect();
|
||||
} else {
|
||||
#ifdef TOOLS_ENABLED
|
||||
Node *edited_root = get_tree()->get_edited_scene_root();
|
||||
if (edited_root && (this == edited_root || edited_root->is_ancestor_of(this))) {
|
||||
Node *edited_scene_root = get_tree()->get_edited_scene_root();
|
||||
Node *scene_root_parent = edited_scene_root ? edited_scene_root->get_parent() : nullptr;
|
||||
|
||||
if (scene_root_parent && get_viewport() == scene_root_parent->get_viewport()) {
|
||||
parent_rect.size = Size2(GLOBAL_GET("display/window/size/viewport_width"), GLOBAL_GET("display/window/size/viewport_height"));
|
||||
} else {
|
||||
parent_rect = get_viewport()->get_visible_rect();
|
||||
|
Loading…
Reference in New Issue
Block a user