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:
@ -913,14 +913,15 @@ void Spatial::show() {
|
|||||||
|
|
||||||
data.visible = true;
|
data.visible = true;
|
||||||
|
|
||||||
if (!is_inside_tree()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool parent_visible = get_parent_spatial() ? get_parent_spatial()->data.visible_in_tree : true;
|
bool parent_visible = get_parent_spatial() ? get_parent_spatial()->data.visible_in_tree : true;
|
||||||
if (parent_visible) {
|
if (parent_visible) {
|
||||||
_propagate_visible_in_tree(true);
|
_propagate_visible_in_tree(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!is_inside_tree()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
_propagate_visibility_changed();
|
_propagate_visibility_changed();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -931,14 +932,15 @@ void Spatial::hide() {
|
|||||||
|
|
||||||
data.visible = false;
|
data.visible = false;
|
||||||
|
|
||||||
if (!is_inside_tree()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool parent_visible = get_parent_spatial() ? get_parent_spatial()->data.visible_in_tree : true;
|
bool parent_visible = get_parent_spatial() ? get_parent_spatial()->data.visible_in_tree : true;
|
||||||
if (parent_visible) {
|
if (parent_visible) {
|
||||||
_propagate_visible_in_tree(false);
|
_propagate_visible_in_tree(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!is_inside_tree()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
_propagate_visibility_changed();
|
_propagate_visibility_changed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user