Merge pull request #59160 from taigi100/Bugfix-#59003-Controls-not-laid-properly-with-FlowContainer-in-another-container

Fix children visibility check
This commit is contained in:
Rémi Verschelde 2022-03-16 22:03:45 +01:00 committed by GitHub
commit d9bd33d406
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -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()) {