Merge pull request #16973 from JFonS/fix_initial_gizmo_visibility

Fix visibility of gizmos on scene load
This commit is contained in:
Rémi Verschelde 2018-02-24 14:06:50 +01:00 committed by GitHub
commit bc4b7bc82e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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();
}