summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-11-06 22:07:00 +0100
committerGitHub <noreply@github.com>2018-11-06 22:07:00 +0100
commit5099b9d79ac4aee0c4dd22ecf64d0ff8669f9c28 (patch)
tree2ad21f82b94c9e08d256d9a615ff5f40e8f04994 /editor
parent8f39b36a1a69e705d034b355b9a8eb990421bb75 (diff)
parent742a9d902351075e353c3e6ba9fa5b1f67dd373f (diff)
Merge pull request #23561 from groud/fix_scaling
Fixes uniform scaling issues (for real this time)
Diffstat (limited to 'editor')
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index bb3ae1dac9..45f7f36cbd 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -1696,13 +1696,7 @@ bool CanvasItemEditor::_gui_input_scale(const Ref<InputEvent> &p_event) {
if (drag_type == DRAG_SCALE_BOTH) {
Size2 scale_factor = drag_to_local / drag_from_local;
if (uniform) {
- if (ABS(scale_factor.x - 1.0) > ABS(scale_factor.y - 1.0)) {
- scale.x *= scale_factor.x;
- scale.y = scale.x * ratio;
- } else {
- scale.y *= scale_factor.y;
- scale.x = scale.y / ratio;
- }
+ scale *= (scale_factor.x + scale_factor.y) / 2.0;
} else {
scale *= scale_factor;
}