summaryrefslogtreecommitdiff
path: root/editor/plugins/canvas_item_editor_plugin.cpp
diff options
context:
space:
mode:
authorgroud <gilles.roudiere@gmail.com>2018-11-05 23:31:57 +0100
committergroud <gilles.roudiere@gmail.com>2018-11-05 23:31:57 +0100
commitc2b6a900fcb7db4645a8b94998c6257c5d82978c (patch)
tree9cd2179d6b0b9bb77fce997f583cde98d32e9194 /editor/plugins/canvas_item_editor_plugin.cpp
parentd4028a3f501455278045e9ce53b87ac8b0600b7a (diff)
Fixes uniform scaling weird behavior
Diffstat (limited to 'editor/plugins/canvas_item_editor_plugin.cpp')
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index 31dd20e453..bb3ae1dac9 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -1696,7 +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(offset.x) > ABS(offset.y)) {
+ if (ABS(scale_factor.x - 1.0) > ABS(scale_factor.y - 1.0)) {
scale.x *= scale_factor.x;
scale.y = scale.x * ratio;
} else {