Skip to content

Commit

Permalink
Merge pull request #23224 from capnm/fix-Align-selection-with-view-in…
Browse files Browse the repository at this point in the history
…-orthogonal-mode

Fix 'Align selection with view' in orthogonal mode
  • Loading branch information
akien-mga authored Oct 22, 2018
2 parents 919573f + 808b46c commit b77a411
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions editor/plugins/spatial_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2535,8 +2535,14 @@ void SpatialEditorViewport::_menu_option(int p_option) {
if (!se)
continue;

Transform xform = camera_transform;
xform.scale_basis(sp->get_scale());
Transform xform;
if (orthogonal) {
xform = sp->get_global_transform();
xform.basis.set_euler(camera_transform.basis.get_euler());
} else {
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_gizmo_transform());
Expand Down

0 comments on commit b77a411

Please sign in to comment.