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-08-10 07:03:37 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-08-10 07:03:37 +0300
commitd5289f9d80291e28111e0d5dcd5f3c290f20a4af (patch)
tree80e8713d4d6efcc85dbebb471191bbc452c3eec9 /source/blender/editors/manipulator_library
parent535d917870b508054790c7041c5e0fa8214f16ef (diff)
Manipulator: apply cage2d scale before offset
Needed when offset takes factor into account.
Diffstat (limited to 'source/blender/editors/manipulator_library')
-rw-r--r--source/blender/editors/manipulator_library/manipulator_types/cage2d_manipulator.c28
1 files changed, 14 insertions, 14 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 11e9982fede..99f252d1ec7 100644
--- a/source/blender/editors/manipulator_library/manipulator_types/cage2d_manipulator.c
+++ b/source/blender/editors/manipulator_library/manipulator_types/cage2d_manipulator.c
@@ -576,11 +576,6 @@ static void manipulator_rect_transform_modal(
wmManipulatorProperty *mpr_prop;
- mpr_prop = WM_manipulator_target_property_find(mpr, "offset");
- if (mpr_prop->type != NULL) {
- WM_manipulator_target_property_value_set_array(C, mpr, mpr_prop, offset);
- }
-
mpr_prop = WM_manipulator_target_property_find(mpr, "scale");
if (mpr_prop->type != NULL) {
if (transform_flag & ED_MANIPULATOR_RECT_TRANSFORM_FLAG_SCALE_UNIFORM) {
@@ -597,21 +592,26 @@ static void manipulator_rect_transform_modal(
}
}
+ mpr_prop = WM_manipulator_target_property_find(mpr, "offset");
+ if (mpr_prop->type != NULL) {
+ WM_manipulator_target_property_value_set_array(C, mpr, mpr_prop, offset);
+ }
+
/* tag the region for redraw */
ED_region_tag_redraw(CTX_wm_region(C));
}
static void manipulator_rect_transform_property_update(wmManipulator *mpr, wmManipulatorProperty *mpr_prop)
{
- if (STREQ(mpr_prop->type->idname, "offset")) {
- manipulator_rect_transform_get_prop_value(mpr, mpr_prop, mpr->matrix_offset[3]);
- }
- else if (STREQ(mpr_prop->type->idname, "scale")) {
+ if (STREQ(mpr_prop->type->idname, "scale")) {
float scale[2];
manipulator_rect_transform_get_prop_value(mpr, mpr_prop, scale);
mpr->matrix_offset[0][0] = scale[0];
mpr->matrix_offset[1][1] = scale[1];
}
+ else if (STREQ(mpr_prop->type->idname, "offset")) {
+ manipulator_rect_transform_get_prop_value(mpr, mpr_prop, mpr->matrix_offset[3]);
+ }
else {
BLI_assert(0);
}
@@ -627,11 +627,6 @@ static void manipulator_rect_transform_exit(bContext *C, wmManipulator *mpr, con
wmManipulatorProperty *mpr_prop;
/* reset properties */
- mpr_prop = WM_manipulator_target_property_find(mpr, "offset");
- if (mpr_prop->type != NULL) {
- WM_manipulator_target_property_value_set_array(C, mpr, mpr_prop, data->orig_matrix_offset[3]);
- }
-
mpr_prop = WM_manipulator_target_property_find(mpr, "scale");
if (mpr_prop->type != NULL) {
const float orig_scale[2] = {data->orig_matrix_offset[0][0], data->orig_matrix_offset[1][1]};
@@ -649,6 +644,11 @@ static void manipulator_rect_transform_exit(bContext *C, wmManipulator *mpr, con
}
}
+ mpr_prop = WM_manipulator_target_property_find(mpr, "offset");
+ if (mpr_prop->type != NULL) {
+ WM_manipulator_target_property_value_set_array(C, mpr, mpr_prop, data->orig_matrix_offset[3]);
+ }
+
copy_m4_m4(mpr->matrix_offset, data->orig_matrix_offset);
}