diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-08-30 20:07:05 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-08-30 20:07:05 +0300 |
commit | cc830e25869c702fa8e648ce74aae615bbeded4b (patch) | |
tree | b66022f4de689d94f56b02a18b3edf847d3efb6e /source/blender/editors/manipulator_library/manipulator_types | |
parent | eafe96a718529dc650888afc91cea14e35170953 (diff) |
Manipulator: correct pivot w/ non 1:1 aspect
Diffstat (limited to 'source/blender/editors/manipulator_library/manipulator_types')
-rw-r--r-- | source/blender/editors/manipulator_library/manipulator_types/cage2d_manipulator.c | 9 |
1 files changed, 9 insertions, 0 deletions
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); |