Fixes uniform scaling issues (for real this time)
This commit is contained in:
parent
c2b6a900fc
commit
742a9d9023
@ -1696,13 +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(scale_factor.x - 1.0) > ABS(scale_factor.y - 1.0)) {
|
scale *= (scale_factor.x + scale_factor.y) / 2.0;
|
||||||
scale.x *= scale_factor.x;
|
|
||||||
scale.y = scale.x * ratio;
|
|
||||||
} else {
|
|
||||||
scale.y *= scale_factor.y;
|
|
||||||
scale.x = scale.y / ratio;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
scale *= scale_factor;
|
scale *= scale_factor;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user