1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-12 13:20:55 +00:00

Set correct position of node with Align Transform with View in orthogonal mode

This commit is contained in:
yds
2024-11-11 21:20:00 -03:00
committed by ydeltastar
parent 6392241742
commit e787252396

View File

@@ -3584,12 +3584,11 @@ void Node3DEditorViewport::_menu_option(int p_option) {
continue; continue;
} }
Transform3D xform; Transform3D xform = camera_transform;
if (orthogonal) { if (orthogonal) {
xform = sp->get_global_transform(); Vector3 offset = camera_transform.basis.xform(Vector3(0, 0, cursor.distance));
xform.basis = Basis::from_euler(camera_transform.basis.get_euler()); xform.origin = cursor.pos + offset;
} else { } else {
xform = camera_transform;
xform.scale_basis(sp->get_scale()); xform.scale_basis(sp->get_scale());
} }