Fix is_visible_in_tree regression for out of tree

This commit is contained in:
lawnjelly
2025-08-28 18:08:00 +01:00
parent d926ccf7e6
commit e56cf87f3c

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();
}