diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-07-03 10:03:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-03 10:03:00 +0200 |
commit | afbb5261e660acf08dd62f698d353e95fc7fb6bb (patch) | |
tree | b4face1192d371443153bce9fe8056d068ec2f2c /scene/3d/spatial.cpp | |
parent | bb6e73f9c155c0340fa4a152fa60a146f0ae744f (diff) | |
parent | 6ed2b0eabcae025117118e8db40fe045620fc9be (diff) |
Merge pull request #9471 from volzhs/visibility-changes
Update visibility icon properly
Diffstat (limited to 'scene/3d/spatial.cpp')
-rw-r--r-- | scene/3d/spatial.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/scene/3d/spatial.cpp b/scene/3d/spatial.cpp index 3debbf02c3..20c2cc1eb5 100644 --- a/scene/3d/spatial.cpp +++ b/scene/3d/spatial.cpp @@ -541,10 +541,7 @@ void Spatial::show() { if (!is_inside_tree()) return; - if (!data.parent || is_visible_in_tree()) { - - _propagate_visibility_changed(); - } + _propagate_visibility_changed(); } void Spatial::hide() { @@ -552,14 +549,14 @@ void Spatial::hide() { if (!data.visible) return; - bool was_visible = is_visible_in_tree(); data.visible = false; - if (!data.parent || was_visible) { + if (!is_inside_tree()) + return; - _propagate_visibility_changed(); - } + _propagate_visibility_changed(); } + bool Spatial::is_visible_in_tree() const { const Spatial *s = this; |