summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-02-24 14:06:50 +0100
committerGitHub <noreply@github.com>2018-02-24 14:06:50 +0100
commitbc4b7bc82e9a68975849de92ab6bdcd3f5ef4e62 (patch)
tree912f1530d19c50201ba657cbf3acd7a02a0880a3
parent36285cd82fb323a18e1534740312a5cf2cde1d06 (diff)
parent99d740c46ed69f53a9ce55e38436f156cec3b69d (diff)
Merge pull request #16973 from JFonS/fix_initial_gizmo_visibility
Fix visibility of gizmos on scene load
-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 721641e09b..f8a5c7f400 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();
}