aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJFonS2018-02-24 12:05:43 +0100
committerHein-Pieter van Braam2018-02-27 00:02:01 +0100
commit69274ef368aef0ef2da2e1a55adb63846f158e4b (patch)
tree904fa8c63cdb40fe67e9056485e04f1ad0136bfd
parent039fc750d5f7cdfe92eb639400ecf488931f1d72 (diff)
downloadgodot-69274ef368aef0ef2da2e1a55adb63846f158e4b.tar.gz
godot-69274ef368aef0ef2da2e1a55adb63846f158e4b.tar.zst
godot-69274ef368aef0ef2da2e1a55adb63846f158e4b.zip
Fix visibility of gizmos on scene load
(cherry picked from commit 99d740c46ed69f53a9ce55e38436f156cec3b69d)
Diffstat (limited to '')
-rw-r--r--scene/3d/spatial.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/scene/3d/spatial.cpp b/scene/3d/spatial.cpp
index 721641e09..f8a5c7f40 100644
--- a/scene/3d/spatial.cpp
+++ b/scene/3d/spatial.cpp
@@ -188,7 +188,9 @@ void Spatial::_notification(int p_what) {
if (data.gizmo.is_valid()) {
data.gizmo->create();
if (data.gizmo->can_draw()) {
- data.gizmo->redraw();
+ if (is_visible_in_tree()) {
+ data.gizmo->redraw();
+ }
}
data.gizmo->transform();
}
@@ -409,7 +411,9 @@ void Spatial::set_gizmo(const Ref<SpatialGizmo> &p_gizmo) {
data.gizmo->create();
if (data.gizmo->can_draw()) {
- data.gizmo->redraw();
+ if (is_visible_in_tree()) {
+ data.gizmo->redraw();
+ }
}
data.gizmo->transform();
}