Merge pull request #23224 from capnm/fix-Align-selection-with-view-in-orthogonal-mode

Fix 'Align selection with view' in orthogonal mode
This commit is contained in:
Rémi Verschelde 2018-10-22 17:17:05 +02:00 committed by GitHub
commit b77a411258
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

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