summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-03-16 22:03:45 +0100
committerGitHub <noreply@github.com>2022-03-16 22:03:45 +0100
commitd9bd33d4068b1fdab2548625dc15f275e2248f6c (patch)
treefdc4a20e00c97c3475d7b082a306ff1c8bc5a79f /scene
parentd3f983262fbc272c66c20d03f82b6dc658e37f4b (diff)
parent280956ddc325568af94b354630cfa28058b07e63 (diff)
Merge pull request #59160 from taigi100/Bugfix-#59003-Controls-not-laid-properly-with-FlowContainer-in-another-container
Fix children visibility check
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/flow_container.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/scene/gui/flow_container.cpp b/scene/gui/flow_container.cpp
index 3bd21f96b2..40aca555db 100644
--- a/scene/gui/flow_container.cpp
+++ b/scene/gui/flow_container.cpp
@@ -39,6 +39,11 @@ struct _LineData {
};
void FlowContainer::_resort() {
+ // Avoid resorting if invisible.
+ if (!is_visible_in_tree()) {
+ return;
+ }
+
int separation_horizontal = get_theme_constant(SNAME("hseparation"));
int separation_vertical = get_theme_constant(SNAME("vseparation"));
@@ -58,7 +63,7 @@ void FlowContainer::_resort() {
// First pass for line wrapping and minimum size calculation.
for (int i = 0; i < get_child_count(); i++) {
Control *child = Object::cast_to<Control>(get_child(i));
- if (!child || !child->is_visible_in_tree()) {
+ if (!child || !child->is_visible()) {
continue;
}
if (child->is_set_as_top_level()) {
@@ -128,7 +133,7 @@ void FlowContainer::_resort() {
for (int i = 0; i < get_child_count(); i++) {
Control *child = Object::cast_to<Control>(get_child(i));
- if (!child || !child->is_visible_in_tree()) {
+ if (!child || !child->is_visible()) {
continue;
}
if (child->is_set_as_top_level()) {