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>2014-02-22 09:19:02 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-02-22 09:30:48 +0400
commit739ae1d80956759767e137fe17286dc360788a1b (patch)
tree64736e18dccebcc24cc4f96b530eeca1f1f3f775 /source/blender/editors/interface/view2d_ops.c
parent3a44e975a9c96521b722d631207b87d0210e1202 (diff)
NDOF: fix for view3d ignoring lens values when panning
image, mce, view2d and view3d now have matching pan speed.
Diffstat (limited to 'source/blender/editors/interface/view2d_ops.c')
-rw-r--r--source/blender/editors/interface/view2d_ops.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c
index a8f01b7aa5a..1f63ad87b37 100644
--- a/source/blender/editors/interface/view2d_ops.c
+++ b/source/blender/editors/interface/view2d_ops.c
@@ -1262,12 +1262,11 @@ static int view2d_ndof_invoke(bContext *C, wmOperator *op, const wmEvent *event)
return OPERATOR_CANCELLED;
}
else {
- wmNDOFMotionData *ndof = (wmNDOFMotionData *) event->customdata;
+ const wmNDOFMotionData *ndof = event->customdata;
- float dt = ndof->dt;
/* tune these until it feels right */
const float zoom_sensitivity = 0.5f;
- const float pan_sensitivity = 10.0f; /* match view3d ortho */
+ const float speed = 10.0f; /* match view3d ortho */
const bool has_translate = (ndof->tvec[0] && ndof->tvec[1]) && view_pan_poll(C);
const bool has_zoom = (ndof->tvec[2] != 0.0f) && view_zoom_poll(C);
@@ -1278,8 +1277,8 @@ static int view2d_ndof_invoke(bContext *C, wmOperator *op, const wmEvent *event)
WM_event_ndof_pan_get(ndof, pan_vec, false);
- pan_vec[0] *= pan_sensitivity;
- pan_vec[1] *= pan_sensitivity;
+ pan_vec[0] *= speed;
+ pan_vec[1] *= speed;
vpd = op->customdata;
@@ -1292,7 +1291,7 @@ static int view2d_ndof_invoke(bContext *C, wmOperator *op, const wmEvent *event)
if (has_zoom) {
if (view_zoomdrag_init(C, op)) {
v2dViewZoomData *vzd;
- float zoom_factor = zoom_sensitivity * dt * -ndof->tvec[2];
+ float zoom_factor = zoom_sensitivity * ndof->dt * -ndof->tvec[2];
bool do_zoom_xy[2];