Browse Source

Merge pull request #23538 from groud/fix_scaling

Fixes uniform scaling weird behavior
Rémi Verschelde 6 years ago
parent
commit
89dd51d433
1 changed files with 1 additions and 1 deletions
  1. 1 1
      editor/plugins/canvas_item_editor_plugin.cpp

+ 1 - 1
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) {
 			if (drag_type == DRAG_SCALE_BOTH) {
 				Size2 scale_factor = drag_to_local / drag_from_local;
 				Size2 scale_factor = drag_to_local / drag_from_local;
 				if (uniform) {
 				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.x *= scale_factor.x;
 						scale.y = scale.x * ratio;
 						scale.y = scale.x * ratio;
 					} else {
 					} else {