diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-03-21 15:31:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-21 15:31:47 +0100 |
commit | 7ed9da0a5438872a8034be1eb04f9199aef640d2 (patch) | |
tree | be6b3c1453bc99c27022c038ffe90ac832ba8192 /editor | |
parent | 9547018bcf7c4cf0d7f10fc1472f9a4cb5b9e7fc (diff) | |
parent | 19825436d4d77025cb48c85a3d7300ff8857b12e (diff) |
Merge pull request #37161 from simpuid/positon-gizmo-fix
Fixes transform gizmo position when node has default transform
Diffstat (limited to 'editor')
-rw-r--r-- | editor/plugins/spatial_editor_plugin.cpp | 3 | ||||
-rw-r--r-- | editor/plugins/spatial_editor_plugin.h | 6 |
2 files changed, 7 insertions, 2 deletions
diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index c305c181cc..2f1274a99a 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -2419,9 +2419,10 @@ void SpatialEditorViewport::_notification(int p_what) { Transform t = sp->get_global_gizmo_transform(); exist = true; - if (se->last_xform == t) + if (se->last_xform == t && !se->last_xform_dirty) continue; changed = true; + se->last_xform_dirty = false; se->last_xform = t; VisualInstance *vi = Object::cast_to<VisualInstance>(sp); diff --git a/editor/plugins/spatial_editor_plugin.h b/editor/plugins/spatial_editor_plugin.h index 9f78efacaf..b67459b9d0 100644 --- a/editor/plugins/spatial_editor_plugin.h +++ b/editor/plugins/spatial_editor_plugin.h @@ -482,10 +482,14 @@ public: Transform original; // original location when moving Transform original_local; Transform last_xform; // last transform + bool last_xform_dirty; Spatial *sp; RID sbox_instance; - SpatialEditorSelectedItem() { sp = NULL; } + SpatialEditorSelectedItem() { + sp = NULL; + last_xform_dirty = true; + } ~SpatialEditorSelectedItem(); }; |