Manipulator: correct pivot w/ non 1:1 aspect
authorCampbell Barton <ideasman42@gmail.com>
Wed, 30 Aug 2017 17:07:05 +0000 (03:07 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 30 Aug 2017 17:07:05 +0000 (03:07 +1000)
source/blender/editors/manipulator_library/manipulator_types/cage2d_manipulator.c

index 7187e3ff62ebc10015a84f10a2c984ab5592fe36..1e4bf51d00f11a6e8c02517ec8e27e8c095ea181 100644 (file)
@@ -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);