From 6ed2b0eabcae025117118e8db40fe045620fc9be Mon Sep 17 00:00:00 2001 From: volzhs Date: Mon, 3 Jul 2017 00:27:27 +0900 Subject: Update visibility icon properly --- scene/3d/spatial.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'scene') 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; -- cgit v1.2.3