diff --git a/scene/gui/aspect_ratio_container.cpp b/scene/gui/aspect_ratio_container.cpp index 1663a7d602a3..e9c178e42340 100644 --- a/scene/gui/aspect_ratio_container.cpp +++ b/scene/gui/aspect_ratio_container.cpp @@ -35,7 +35,7 @@ Size2 AspectRatioContainer::get_minimum_size() const { Size2 ms; for (int i = 0; i < get_child_count(); i++) { - Control *c = as_sortable_control(get_child(i)); + Control *c = as_sortable_control(get_child(i), SortableVisbilityMode::VISIBLE); if (!c) { continue; } diff --git a/scene/gui/center_container.cpp b/scene/gui/center_container.cpp index 1af33d28144c..5dc336ceb572 100644 --- a/scene/gui/center_container.cpp +++ b/scene/gui/center_container.cpp @@ -36,7 +36,7 @@ Size2 CenterContainer::get_minimum_size() const { } Size2 ms; for (int i = 0; i < get_child_count(); i++) { - Control *c = as_sortable_control(get_child(i)); + Control *c = as_sortable_control(get_child(i), SortableVisbilityMode::VISIBLE); if (!c) { continue; } diff --git a/scene/gui/flow_container.cpp b/scene/gui/flow_container.cpp index f77d66fe98ca..eedcd473fbe9 100644 --- a/scene/gui/flow_container.cpp +++ b/scene/gui/flow_container.cpp @@ -250,7 +250,7 @@ Size2 FlowContainer::get_minimum_size() const { Size2i minimum; for (int i = 0; i < get_child_count(); i++) { - Control *c = as_sortable_control(get_child(i)); + Control *c = as_sortable_control(get_child(i), SortableVisbilityMode::VISIBLE); if (!c) { continue; } diff --git a/scene/gui/split_container.cpp b/scene/gui/split_container.cpp index 925600756a88..8ab9b4c1cdd9 100644 --- a/scene/gui/split_container.cpp +++ b/scene/gui/split_container.cpp @@ -122,11 +122,11 @@ void SplitContainerDragger::_notification(int p_what) { } } -Control *SplitContainer::_get_sortable_child(int p_idx) const { +Control *SplitContainer::_get_sortable_child(int p_idx, SortableVisbilityMode p_visibility_mode) const { int idx = 0; for (int i = 0; i < get_child_count(false); i++) { - Control *c = as_sortable_control(get_child(i, false)); + Control *c = as_sortable_control(get_child(i, false), p_visibility_mode); if (!c) { continue; } @@ -258,7 +258,8 @@ Size2 SplitContainer::get_minimum_size() const { int sep = (dragger_visibility != DRAGGER_HIDDEN_COLLAPSED) ? MAX(theme_cache.separation, vertical ? g->get_height() : g->get_width()) : 0; for (int i = 0; i < 2; i++) { - if (!_get_sortable_child(i)) { + Control *child = _get_sortable_child(i, SortableVisbilityMode::VISIBLE); + if (!child) { break; } @@ -270,7 +271,7 @@ Size2 SplitContainer::get_minimum_size() const { } } - Size2 ms = _get_sortable_child(i)->get_combined_minimum_size(); + Size2 ms = child->get_combined_minimum_size(); if (vertical) { minimum.height += ms.height; diff --git a/scene/gui/split_container.h b/scene/gui/split_container.h index 95f26f5e0ba3..db870554c20c 100644 --- a/scene/gui/split_container.h +++ b/scene/gui/split_container.h @@ -82,7 +82,7 @@ class SplitContainer : public Container { Ref _get_grabber_icon() const; void _compute_middle_sep(bool p_clamp); void _resort(); - Control *_get_sortable_child(int p_idx) const; + Control *_get_sortable_child(int p_idx, SortableVisbilityMode p_visibility_mode = SortableVisbilityMode::VISIBLE_IN_TREE) const; protected: bool is_fixed = false;