Merge pull request #110059 from lawnjelly/fix_visible_out_of_tree

[3.x] Fix `is_visible_in_tree` regression for out of tree
This commit is contained in:
lawnjelly
2025-08-29 05:51:17 +01:00
committed by GitHub

View File

@ -913,14 +913,15 @@ void Spatial::show() {
data.visible = true;
if (!is_inside_tree()) {
return;
}
bool parent_visible = get_parent_spatial() ? get_parent_spatial()->data.visible_in_tree : true;
if (parent_visible) {
_propagate_visible_in_tree(true);
}
if (!is_inside_tree()) {
return;
}
_propagate_visibility_changed();
}
@ -931,14 +932,15 @@ void Spatial::hide() {
data.visible = false;
if (!is_inside_tree()) {
return;
}
bool parent_visible = get_parent_spatial() ? get_parent_spatial()->data.visible_in_tree : true;
if (parent_visible) {
_propagate_visible_in_tree(false);
}
if (!is_inside_tree()) {
return;
}
_propagate_visibility_changed();
}