diff options
Diffstat (limited to 'scene/gui/margin_container.cpp')
-rw-r--r-- | scene/gui/margin_container.cpp | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/scene/gui/margin_container.cpp b/scene/gui/margin_container.cpp index 6d331afbb5..91e6c1f092 100644 --- a/scene/gui/margin_container.cpp +++ b/scene/gui/margin_container.cpp @@ -36,16 +36,10 @@ Size2 MarginContainer::get_minimum_size() const { Size2 max; for (int i = 0; i < get_child_count(); i++) { - Control *c = Object::cast_to<Control>(get_child(i)); + Control *c = as_sortable_control(get_child(i)); if (!c) { continue; } - if (c->is_set_as_top_level()) { - continue; - } - if (!c->is_visible()) { - continue; - } Size2 s = c->get_combined_minimum_size(); if (s.width > max.width) { @@ -103,13 +97,10 @@ void MarginContainer::_notification(int p_what) { Size2 s = get_size(); for (int i = 0; i < get_child_count(); i++) { - Control *c = Object::cast_to<Control>(get_child(i)); + Control *c = as_sortable_control(get_child(i)); if (!c) { continue; } - if (c->is_set_as_top_level()) { - continue; - } int w = s.width - theme_cache.margin_left - theme_cache.margin_right; int h = s.height - theme_cache.margin_top - theme_cache.margin_bottom; |