diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-08-04 02:23:50 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-08-04 02:23:50 +0300 |
commit | caf1a5fc44c2c87c05cd4e850f332e6c033d288e (patch) | |
tree | 328f18f237af0b5f114dbd00a262320eaaeb20ce /source | |
parent | e16e96433f21fad3f285008d3a038ca722783ebe (diff) |
Manipulator: correct center-pivot clamping
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/manipulator_library/manipulator_types/cage2d_manipulator.c | 8 |
1 files changed, 4 insertions, 4 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 7766299225f..e75142119ab 100644 --- a/source/blender/editors/manipulator_library/manipulator_types/cage2d_manipulator.c +++ b/source/blender/editors/manipulator_library/manipulator_types/cage2d_manipulator.c @@ -514,14 +514,14 @@ static void manipulator_rect_transform_modal( mpr->matrix_offset[3][1] = data->orig_offset[1] + valuey; } else if (mpr->highlight_part == ED_MANIPULATOR_RECT_TRANSFORM_INTERSECT_SCALEX_LEFT) { - valuex = min_ff(valuex, dims[0] * data->orig_scale[0] / (pivot_center ? 2 : 1)); + valuex = min_ff(valuex, (dims[0] * data->orig_scale[0]) * (pivot_center ? 2 : 1)); if (pivot_center == false) { mpr->matrix_offset[3][0] = data->orig_offset[0] + valuex / 2.0f; } scale[0] = (dims[0] * data->orig_scale[0] - valuex) / dims[0]; } else if (mpr->highlight_part == ED_MANIPULATOR_RECT_TRANSFORM_INTERSECT_SCALEX_RIGHT) { - valuex = max_ff(valuex, dims[0] * data->orig_scale[0] / (pivot_center ? -2 : -1)); + valuex = max_ff(valuex, (dims[0] * data->orig_scale[0]) * (pivot_center ? -2 : -1)); if (pivot_center == false) { mpr->matrix_offset[3][0] = data->orig_offset[0] + valuex / 2.0f; } @@ -529,7 +529,7 @@ static void manipulator_rect_transform_modal( } else if (mpr->highlight_part == ED_MANIPULATOR_RECT_TRANSFORM_INTERSECT_SCALEY_DOWN) { int a = (transform_flag & ED_MANIPULATOR_RECT_TRANSFORM_FLAG_SCALE_UNIFORM) ? 0 : 1; - valuey = min_ff(valuey, dims[1] * data->orig_scale[a] / (pivot_center ? 2 : 1)); + valuey = min_ff(valuey, (dims[1] * data->orig_scale[a]) * (pivot_center ? 2 : 1)); if (pivot_center == false) { mpr->matrix_offset[3][1] = data->orig_offset[1] + valuey / 2.0f; } @@ -537,7 +537,7 @@ static void manipulator_rect_transform_modal( } else if (mpr->highlight_part == ED_MANIPULATOR_RECT_TRANSFORM_INTERSECT_SCALEY_UP) { int a = (transform_flag & ED_MANIPULATOR_RECT_TRANSFORM_FLAG_SCALE_UNIFORM) ? 0 : 1; - valuey = max_ff(valuey, dims[1] * data->orig_scale[a] / (pivot_center ? -2 : -1)); + valuey = max_ff(valuey, (dims[1] * data->orig_scale[a]) * (pivot_center ? -2 : -1)); if (pivot_center == false) { mpr->matrix_offset[3][1] = data->orig_offset[1] + valuey / 2.0f; } |