Fix 'Align selection with view' in orthogonal mode

Fixes #23096
This commit is contained in:
Martin Capitanio 2018-10-22 16:52:39 +02:00
parent 955a913a1f
commit 808b46cfc2
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());