diff options
author | Franklin Sobrinho <franklin_gs@hotmail.com> | 2015-10-29 20:44:12 -0300 |
---|---|---|
committer | Franklin Sobrinho <franklin_gs@hotmail.com> | 2015-10-29 20:44:12 -0300 |
commit | 18392e28b6ab689ce334bc112f259b5d8be5c2ce (patch) | |
tree | 71d7308dc0685c4d1dfa67f8066733ca3eac95d4 | |
parent | bd736e5af2ec5113c23fef58523f57a0b2e11fb2 (diff) |
Fix "Align with view" undo, fixes #1443
-rw-r--r-- | tools/editor/plugins/spatial_editor_plugin.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/editor/plugins/spatial_editor_plugin.cpp b/tools/editor/plugins/spatial_editor_plugin.cpp index 3ab9339265..dadd8c3050 100644 --- a/tools/editor/plugins/spatial_editor_plugin.cpp +++ b/tools/editor/plugins/spatial_editor_plugin.cpp @@ -1957,11 +1957,11 @@ void SpatialEditorViewport::_menu_option(int p_option) { if (!se) continue; - Vector3 original_scale = sp->get_scale(); - sp->set_global_transform(camera_transform); - sp->set_scale(original_scale); - undo_redo->add_do_method(sp,"set_global_transform",sp->get_global_transform()); - undo_redo->add_undo_method(sp,"set_global_transform",se->original); + Transform xform = camera_transform; + xform.scale_basis(sp->get_scale()); + + undo_redo->add_do_method(sp,"set_global_transform",xform); + undo_redo->add_undo_method(sp,"set_global_transform",sp->get_global_transform()); } undo_redo->commit_action(); } break; |