summaryrefslogtreecommitdiffstats
path: root/editor
diff options
context:
space:
mode:
authorThaddeus Crews <repiteo@outlook.com>2024-11-25 13:22:28 -0600
committerThaddeus Crews <repiteo@outlook.com>2024-11-25 13:22:28 -0600
commit81733e66224ea113cf32b69ea93a6c1342d9c6e7 (patch)
tree817c4ddc313fc2edc23dd9c113c9267b17f23e12 /editor
parent29e6ef4277e9d43cbffc8a1bd837e97db8bac0f5 (diff)
parentc4bb252294f9e081809df0cd9ff47009136af01d (diff)
downloadredot-engine-81733e66224ea113cf32b69ea93a6c1342d9c6e7.tar.gz
Merge pull request #99506 from Giganzo/scale-2d-selection
Change how multi selection scale is applied to canvas item
Diffstat (limited to 'editor')
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp15
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 d3bae447cc..f73867575d 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;