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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-01-29 09:40:19 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-01-29 09:40:19 +0300
commitbe0b2ac18b81cd10fd336df02b9b076536af7418 (patch)
tree281e4c5b2c6d0ca413acd0ccb249f3e2c2b116fc /source
parentda885b922c1c2aeed8776504bad57e8e3bb2c2e6 (diff)
Manipulator: ignore mouse location w/ view widgets
When pressing on a button to zoom for eg, using zoom-to-mouse-position doesn't make any sense. There is also zoom speed scaling which increases the closer the cursor is to the top-edge of the screen, which was noticable since the navigation widget is currently at the top of the screen.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/space_view3d/view3d_manipulator_navigate.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/editors/space_view3d/view3d_manipulator_navigate.c b/source/blender/editors/space_view3d/view3d_manipulator_navigate.c
index 9f655fff8a1..6a5d63b180f 100644
--- a/source/blender/editors/space_view3d/view3d_manipulator_navigate.c
+++ b/source/blender/editors/space_view3d/view3d_manipulator_navigate.c
@@ -231,6 +231,16 @@ static void WIDGETGROUP_navigate_setup(const bContext *UNUSED(C), wmManipulatorG
}
}
+ /* Modal operators, don't use initial mouse location since we're clicking on a button. */
+ {
+ int mpr_ids[] = {MPR_MOVE, MPR_ROTATE, MPR_ZOOM};
+ for (int i = 0; i < ARRAY_SIZE(mpr_ids); i++) {
+ wmManipulator *mpr = navgroup->mpr_array[mpr_ids[i]];
+ wmManipulatorOpElem *mpop = WM_manipulator_operator_get(mpr, 0);
+ RNA_boolean_set(&mpop->ptr, "use_mouse_init", false);
+ }
+ }
+
{
wmManipulator *mpr = navgroup->mpr_array[MPR_ROTATE];
mpr->scale_basis = MANIPULATOR_SIZE / 2;