diff options
author | Giganzo <158825920+Giganzo@users.noreply.github.com> | 2024-11-21 20:23:24 +0100 |
---|---|---|
committer | Giganzo <158825920+Giganzo@users.noreply.github.com> | 2024-11-21 20:52:33 +0100 |
commit | c4bb252294f9e081809df0cd9ff47009136af01d (patch) | |
tree | a7d054aa50bfe1dad3a65b13141674c95bf5a0ae /editor | |
parent | 9e6098432aac35bae42c9089a29ba2a80320d823 (diff) | |
download | redot-engine-c4bb252294f9e081809df0cd9ff47009136af01d.tar.gz |
Change how multi selection scale is applied to canvas item
Diffstat (limited to 'editor')
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index f91a052a24..187a01c859 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -1995,15 +1995,14 @@ bool CanvasItemEditor::_gui_input_scale(const Ref<InputEvent> &p_event) { } } + Transform2D edit_transform; + bool using_temp_pivot = !Math::is_inf(temp_pivot.x) || !Math::is_inf(temp_pivot.y); + if (using_temp_pivot) { + edit_transform = Transform2D(drag_selection.front()->get()->_edit_get_rotation(), temp_pivot); + } else { + edit_transform = drag_selection.front()->get()->_edit_get_transform(); + } for (CanvasItem *ci : drag_selection) { - Transform2D edit_transform; - bool using_temp_pivot = !Math::is_inf(temp_pivot.x) || !Math::is_inf(temp_pivot.y); - if (using_temp_pivot) { - edit_transform = Transform2D(ci->_edit_get_rotation(), temp_pivot); - } else { - edit_transform = ci->_edit_get_transform(); - } - Transform2D parent_xform = ci->get_global_transform_with_canvas() * ci->get_transform().affine_inverse(); Transform2D unscaled_transform = (transform * parent_xform * edit_transform).orthonormalized(); Transform2D simple_xform = (viewport->get_transform() * unscaled_transform).affine_inverse() * transform; |