[Bf-blender-cvs] [c558d72] epic-navigation: Increase stability of WALK_MOUSE_MOVEVERTICAL mode (MMB) by doing only one movement at a time
Dalai Felinto
noreply at git.blender.org
Tue Aug 25 16:08:08 CEST 2015
Commit: c558d7222876c7998e7c05a51f25f9474fbe9ffa
Author: Dalai Felinto
Date: Tue Aug 25 11:07:30 2015 -0300
Branches: epic-navigation
https://developer.blender.org/rBc558d7222876c7998e7c05a51f25f9474fbe9ffa
Increase stability of WALK_MOUSE_MOVEVERTICAL mode (MMB) by doing only one movement at a time
===================================================================
M source/blender/editors/space_view3d/view3d_walk.c
===================================================================
diff --git a/source/blender/editors/space_view3d/view3d_walk.c b/source/blender/editors/space_view3d/view3d_walk.c
index 37936f3..9179df1 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;
}
More information about the Bf-blender-cvs
mailing list