Fixes uniform scaling weird behavior

This commit is contained in:
groud 2018-11-05 23:31:57 +01:00
parent d4028a3f50
commit c2b6a900fc

View file

@ -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 {