From cc830e25869c702fa8e648ce74aae615bbeded4b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 31 Aug 2017 03:07:05 +1000 Subject: [PATCH] Manipulator: correct pivot w/ non 1:1 aspect --- .../manipulator_types/cage2d_manipulator.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/blender/editors/manipulator_library/manipulator_types/cage2d_manipulator.c b/source/blender/editors/manipulator_library/manipulator_types/cage2d_manipulator.c index 7187e3ff62e..1e4bf51d00f 100644 --- a/source/blender/editors/manipulator_library/manipulator_types/cage2d_manipulator.c +++ b/source/blender/editors/manipulator_library/manipulator_types/cage2d_manipulator.c @@ -580,6 +580,15 @@ static int manipulator_rect_transform_modal( if (transform_flag & ED_MANIPULATOR_CAGE2D_XFORM_FLAG_TRANSLATE) { manipulator_rect_pivot_from_scale_part(mpr->highlight_part, pivot, constrain_axis); + + /* Move pivot to boundary edges w/ non square aspect. */ + if (dims[0] < dims[1]) { + pivot[0] /= dims[1]; + } + else { + pivot[1] /= dims[0]; + } + } else { zero_v2(pivot);