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:
authorDalai Felinto <dfelinto@gmail.com>2015-08-25 17:07:30 +0300
committerDalai Felinto <dfelinto@gmail.com>2015-08-25 17:07:30 +0300
commitc558d7222876c7998e7c05a51f25f9474fbe9ffa (patch)
tree58e368fa4d40841482a24f1a2de5eb910f7354c4
parent88620cd265526711fb69f846d8475188b18bdb78 (diff)
Increase stability of WALK_MOUSE_MOVEVERTICAL mode (MMB) by doing only one movement at a time
-rw-r--r--source/blender/editors/space_view3d/view3d_walk.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/source/blender/editors/space_view3d/view3d_walk.c b/source/blender/editors/space_view3d/view3d_walk.c
index 37936f3cac7..9179df1b5a3 100644
--- a/source/blender/editors/space_view3d/view3d_walk.c
+++ b/source/blender/editors/space_view3d/view3d_walk.c
@@ -1197,15 +1197,21 @@ static int walkApply(bContext *C, wmOperator *op, WalkInfo *walk)
}
case WALK_MOUSE_MOVEVERTICAL:
{
- if (moffset[0] > 0)
- walk_mouse_move(walk, mat, WALK_BIT_RIGHT, time_redraw, dvec);
- else if (moffset[0] < 0)
- walk_mouse_move(walk, mat, WALK_BIT_LEFT, time_redraw, dvec);
-
- if (moffset[1] > 0)
- walk_mouse_move(walk, mat, WALK_BIT_UP, time_redraw, dvec);
- else if (moffset[1] < 0)
- walk_mouse_move(walk, mat, WALK_BIT_DOWN, time_redraw, dvec);
+ /* if we both movements at the same time the effect is too unstable */
+ const bool is_vertical = (abs(moffset[1]) - abs(moffset[0])) > 0;
+
+ if (is_vertical) {
+ if (moffset[1] > 0)
+ walk_mouse_move(walk, mat, WALK_BIT_UP, time_redraw, dvec);
+ else if (moffset[1] < 0)
+ walk_mouse_move(walk, mat, WALK_BIT_DOWN, time_redraw, dvec);
+ }
+ else {
+ if (moffset[0] > 0)
+ walk_mouse_move(walk, mat, WALK_BIT_RIGHT, time_redraw, dvec);
+ else if (moffset[0] < 0)
+ walk_mouse_move(walk, mat, WALK_BIT_LEFT, time_redraw, dvec);
+ }
break;
}