mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Fix visibility changes for Spatial
This commit is contained in:
parent
37eaa9d792
commit
7ca40c3eb9
1 changed files with 5 additions and 8 deletions
|
|
@ -547,10 +547,7 @@ void Spatial::show() {
|
|||
if (!is_inside_tree())
|
||||
return;
|
||||
|
||||
if (!data.parent || is_visible()) {
|
||||
|
||||
_propagate_visibility_changed();
|
||||
}
|
||||
_propagate_visibility_changed();
|
||||
}
|
||||
|
||||
void Spatial::hide() {
|
||||
|
|
@ -558,14 +555,14 @@ void Spatial::hide() {
|
|||
if (!data.visible)
|
||||
return;
|
||||
|
||||
bool was_visible = is_visible();
|
||||
data.visible = false;
|
||||
|
||||
if (!data.parent || was_visible) {
|
||||
if (!is_inside_tree())
|
||||
return;
|
||||
|
||||
_propagate_visibility_changed();
|
||||
}
|
||||
_propagate_visibility_changed();
|
||||
}
|
||||
|
||||
bool Spatial::is_visible() const {
|
||||
|
||||
const Spatial *s = this;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue