diff options
author | JFonS <joan.fonssanchez@gmail.com> | 2018-02-24 12:05:43 +0100 |
---|---|---|
committer | JFonS <joan.fonssanchez@gmail.com> | 2018-02-24 12:05:43 +0100 |
commit | 99d740c46ed69f53a9ce55e38436f156cec3b69d (patch) | |
tree | b852853bc06705d3da1498b21565a93ddac993ad | |
parent | 0712acec1c21b5683f4cfe292bb82f7d1d37cae0 (diff) |
Fix visibility of gizmos on scene load
-rw-r--r-- | scene/3d/spatial.cpp | 8 |
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(); } |