Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2017-09-13 11:19:23 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-09-13 11:20:37 +0300
commit77eaf5cd7a4db325e68dbe4161746ca92ebd6fb0 (patch)
treed2c7cf392a034b4ca86d45c7b92d2e1da6a76b11 /source/blender/editors/manipulator_library
parenta5c9f15a0e4a5f5a7ea8370828815d2f37ae036a (diff)
Manipulator: Only allow negative scale w/ flag set
In most cases we don't want this by default
Diffstat (limited to 'source/blender/editors/manipulator_library')
-rw-r--r--source/blender/editors/manipulator_library/manipulator_types/cage2d_manipulator.c8
1 files changed, 8 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 3d7195e016b..f8379c929db 100644
--- a/source/blender/editors/manipulator_library/manipulator_types/cage2d_manipulator.c
+++ b/source/blender/editors/manipulator_library/manipulator_types/cage2d_manipulator.c
@@ -760,7 +760,15 @@ static int manipulator_rect_transform_modal(
delta_orig[i] *= -1.0f;
delta_curr[i] *= -1.0f;
}
+ const int sign = signum_i(scale[i]);
+
scale[i] = 1.0f + ((delta_curr[i] - delta_orig[i]) / len_v3(data->orig_matrix_offset[i]));
+
+ if ((transform_flag & ED_MANIPULATOR_CAGE2D_XFORM_FLAG_SCALE_SIGNED) == 0) {
+ if (sign != signum_i(scale[i])) {
+ scale[i] = 0.0f;
+ }
+ }
}
}