aboutsummaryrefslogtreecommitdiff
path: root/scene/3d/spatial.cpp
diff options
context:
space:
mode:
authorJFonS2018-02-24 12:05:43 +0100
committerJFonS2018-02-24 12:05:43 +0100
commit99d740c46ed69f53a9ce55e38436f156cec3b69d (patch)
treeb852853bc06705d3da1498b21565a93ddac993ad /scene/3d/spatial.cpp
parent0712acec1c21b5683f4cfe292bb82f7d1d37cae0 (diff)
downloadgodot-99d740c46ed69f53a9ce55e38436f156cec3b69d.tar.gz
godot-99d740c46ed69f53a9ce55e38436f156cec3b69d.tar.zst
godot-99d740c46ed69f53a9ce55e38436f156cec3b69d.zip
Fix visibility of gizmos on scene load
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();
}