Fix visibility of gizmos on scene load

(cherry picked from commit 99d740c46e)
This commit is contained in:
JFonS 2018-02-24 12:05:43 +01:00 committed by Hein-Pieter van Braam
parent 039fc750d5
commit 69274ef368
1 changed files with 6 additions and 2 deletions

View File

@ -188,7 +188,9 @@ void Spatial::_notification(int p_what) {
if (data.gizmo.is_valid()) { if (data.gizmo.is_valid()) {
data.gizmo->create(); data.gizmo->create();
if (data.gizmo->can_draw()) { if (data.gizmo->can_draw()) {
data.gizmo->redraw(); if (is_visible_in_tree()) {
data.gizmo->redraw();
}
} }
data.gizmo->transform(); data.gizmo->transform();
} }
@ -409,7 +411,9 @@ void Spatial::set_gizmo(const Ref<SpatialGizmo> &p_gizmo) {
data.gizmo->create(); data.gizmo->create();
if (data.gizmo->can_draw()) { if (data.gizmo->can_draw()) {
data.gizmo->redraw(); if (is_visible_in_tree()) {
data.gizmo->redraw();
}
} }
data.gizmo->transform(); data.gizmo->transform();
} }