[Bf-blender-cvs] [cc830e25869] blender2.8: Manipulator: correct pivot w/ non 1:1 aspect

Campbell Barton noreply at git.blender.org
Wed Aug 30 19:01:18 CEST 2017


Commit: cc830e25869c702fa8e648ce74aae615bbeded4b
Author: Campbell Barton
Date:   Thu Aug 31 03:07:05 2017 +1000
Branches: blender2.8
https://developer.blender.org/rBcc830e25869c702fa8e648ce74aae615bbeded4b

Manipulator: correct pivot w/ non 1:1 aspect

===================================================================

M	source/blender/editors/manipulator_library/manipulator_types/cage2d_manipulator.c

===================================================================

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);



More information about the Bf-blender-cvs mailing list