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:
commit
b77a411258
|
@ -2535,8 +2535,14 @@ void SpatialEditorViewport::_menu_option(int p_option) {
|
||||||
if (!se)
|
if (!se)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
Transform xform = camera_transform;
|
Transform xform;
|
||||||
xform.scale_basis(sp->get_scale());
|
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_do_method(sp, "set_global_transform", xform);
|
||||||
undo_redo->add_undo_method(sp, "set_global_transform", sp->get_global_gizmo_transform());
|
undo_redo->add_undo_method(sp, "set_global_transform", sp->get_global_gizmo_transform());
|
||||||
|
|
Loading…
Reference in New Issue