summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Capitanio <capnm@capitanio.org>2018-10-22 16:52:39 +0200
committerMartin Capitanio <capnm@capitanio.org>2018-10-22 17:05:16 +0200
commit808b46cfc238aa08a9e8d5123649ad3fa84c5cae (patch)
tree30afc414f12518225326051bbbea45c6a3a5e003
parent955a913a1fcc7551a3e03017eb2ac8edc4ee7043 (diff)
Fix 'Align selection with view' in orthogonal mode
Fixes #23096
-rw-r--r--editor/plugins/spatial_editor_plugin.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp
index b0d405daab..0dda95832c 100644
--- a/editor/plugins/spatial_editor_plugin.cpp
+++ b/editor/plugins/spatial_editor_plugin.cpp
@@ -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());