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-30 18:38:51 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-08-30 19:00:16 +0300
commit00ba48a6997d5421a899101b696e5f86c0bdef0a (patch)
tree8f54f9cd478f88134bea37bb2143e73f83d9a19a /source/blender/windowmanager/manipulators
parentb448b025c70ab4e6966d3469dc71a5318d3ef731 (diff)
Manipulator: replace old cage2d manipulator
Mostly internal changes, keeping both manipulators could have worked but there was no point long term. There are still some glitches to resolve, will work on those next.
Diffstat (limited to 'source/blender/windowmanager/manipulators')
-rw-r--r--source/blender/windowmanager/manipulators/WM_manipulator_types.h5
-rw-r--r--source/blender/windowmanager/manipulators/intern/wm_manipulator.c13
2 files changed, 14 insertions, 4 deletions
diff --git a/source/blender/windowmanager/manipulators/WM_manipulator_types.h b/source/blender/windowmanager/manipulators/WM_manipulator_types.h
index 0894a21e925..22f1eb68181 100644
--- a/source/blender/windowmanager/manipulators/WM_manipulator_types.h
+++ b/source/blender/windowmanager/manipulators/WM_manipulator_types.h
@@ -75,6 +75,11 @@ typedef enum eWM_ManipulatorFlag {
* When set 'scale_final' value also scales the offset.
* Use when offset is to avoid screen-space overlap instead of absolute positioning. */
WM_MANIPULATOR_DRAW_OFFSET_SCALE = (1 << 4),
+ /**
+ * User should still use 'scale_final' for any handles and UI elements.
+ * This simply skips scale when calculating the final matrix.
+ * Needed when the manipulator needs to align with the interface underneath it. */
+ WM_MANIPULATOR_DRAW_NO_SCALE = (1 << 5),
} eWM_ManipulatorFlag;
/**
diff --git a/source/blender/windowmanager/manipulators/intern/wm_manipulator.c b/source/blender/windowmanager/manipulators/intern/wm_manipulator.c
index 5693c4854c9..3df4124ba65 100644
--- a/source/blender/windowmanager/manipulators/intern/wm_manipulator.c
+++ b/source/blender/windowmanager/manipulators/intern/wm_manipulator.c
@@ -548,13 +548,18 @@ void WM_manipulator_calc_matrix_final_params(
copy_m4_m4(final_matrix, matrix_basis);
}
- if (mpr->flag & WM_MANIPULATOR_DRAW_OFFSET_SCALE) {
- mul_mat3_m4_fl(final_matrix, *scale_final);
+ if (mpr->flag & WM_MANIPULATOR_DRAW_NO_SCALE) {
mul_m4_m4m4(final_matrix, final_matrix, matrix_offset);
}
else {
- mul_m4_m4m4(final_matrix, final_matrix, matrix_offset);
- mul_mat3_m4_fl(final_matrix, *scale_final);
+ if (mpr->flag & WM_MANIPULATOR_DRAW_OFFSET_SCALE) {
+ mul_mat3_m4_fl(final_matrix, *scale_final);
+ mul_m4_m4m4(final_matrix, final_matrix, matrix_offset);
+ }
+ else {
+ mul_m4_m4m4(final_matrix, final_matrix, matrix_offset);
+ mul_mat3_m4_fl(final_matrix, *scale_final);
+ }
}
mul_m4_m4m4(r_mat, matrix_space, final_matrix);