diff options
Diffstat (limited to 'scene/gui/panel_container.cpp')
-rw-r--r-- | scene/gui/panel_container.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/scene/gui/panel_container.cpp b/scene/gui/panel_container.cpp index ef85919859..76fde26b26 100644 --- a/scene/gui/panel_container.cpp +++ b/scene/gui/panel_container.cpp @@ -35,11 +35,8 @@ Size2 PanelContainer::get_minimum_size() const { Size2 ms; for (int i = 0; i < get_child_count(); i++) { - Control *c = Object::cast_to<Control>(get_child(i)); - if (!c || !c->is_visible()) { - continue; - } - if (c->is_set_as_top_level()) { + Control *c = as_sortable_control(get_child(i)); + if (!c) { continue; } @@ -87,11 +84,8 @@ void PanelContainer::_notification(int p_what) { } for (int i = 0; i < get_child_count(); i++) { - Control *c = Object::cast_to<Control>(get_child(i)); - if (!c || !c->is_visible_in_tree()) { - continue; - } - if (c->is_set_as_top_level()) { + Control *c = as_sortable_control(get_child(i)); + if (!c) { continue; } |