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>2014-02-18 04:33:40 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-02-18 04:57:48 +0400
commitc4bebc06325abf3a7420d5d07d9bf29b1a6f578b (patch)
tree70bf974144dfc16efee21ae3285373ade5c09dfc /source
parentc67b9f4c3774d72d160901b3d410a685ae8e2359 (diff)
NDOF: fix for broken zoom invert for image and clip editor
also match zoom speed with 3d view
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/space_clip/clip_ops.c5
-rw-r--r--source/blender/editors/space_image/image_ops.c5
2 files changed, 4 insertions, 6 deletions
diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c
index c8eadf952d0..64d96152ba5 100644
--- a/source/blender/editors/space_clip/clip_ops.c
+++ b/source/blender/editors/space_clip/clip_ops.c
@@ -1340,7 +1340,6 @@ static int clip_view_ndof_invoke(bContext *C, wmOperator *UNUSED(op), const wmEv
float dt = ndof->dt;
/* tune these until it feels right */
- const float zoom_sensitivity = 0.5f; /* 50% per second (I think) */
const float pan_sensitivity = 300.0f; /* screen pixels per second */
/* "mouse zoom" factor = 1 + (dx + dy) / 300
@@ -1349,7 +1348,7 @@ static int clip_view_ndof_invoke(bContext *C, wmOperator *UNUSED(op), const wmEv
* move forward -> factor > 1
* move backward -> factor < 1
*/
- float zoom_factor = 1.0f + zoom_sensitivity * dt * - ndof->tvec[2];
+ float zoom_factor = dt * - ndof->tvec[2];
pan_vec[0] = ndof->tvec[0] * ((U.ndof_flag & NDOF_PANX_INVERT_AXIS) ? -1.0f : 1.0f);
pan_vec[1] = ndof->tvec[1] * ((U.ndof_flag & NDOF_PANY_INVERT_AXIS) ? -1.0f : 1.0f);
@@ -1359,7 +1358,7 @@ static int clip_view_ndof_invoke(bContext *C, wmOperator *UNUSED(op), const wmEv
if (U.ndof_flag & NDOF_ZOOM_INVERT)
zoom_factor = -zoom_factor;
- sclip_zoom_set_factor(C, zoom_factor, NULL);
+ sclip_zoom_set_factor(C, 1.0f + zoom_factor, NULL);
sc->xof += pan_vec[0];
sc->yof += pan_vec[1];
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index f48532dbac7..d8159955af9 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -605,7 +605,6 @@ static int image_view_ndof_invoke(bContext *C, wmOperator *UNUSED(op), const wmE
float dt = ndof->dt;
/* tune these until it feels right */
- const float zoom_sensitivity = 0.5f; // 50% per second (I think)
const float pan_sensitivity = 300.f; // screen pixels per second
/* "mouse zoom" factor = 1 + (dx + dy) / 300
@@ -614,7 +613,7 @@ static int image_view_ndof_invoke(bContext *C, wmOperator *UNUSED(op), const wmE
* move forward -> factor > 1
* move backward -> factor < 1
*/
- float zoom_factor = 1.f + zoom_sensitivity * dt * -ndof->tvec[2];
+ float zoom_factor = dt * -ndof->tvec[2];
pan_vec[0] = ndof->tvec[0] * ((U.ndof_flag & NDOF_PANX_INVERT_AXIS) ? -1.0f : 1.0f);
pan_vec[1] = ndof->tvec[1] * ((U.ndof_flag & NDOF_PANY_INVERT_AXIS) ? -1.0f : 1.0f);
@@ -624,7 +623,7 @@ static int image_view_ndof_invoke(bContext *C, wmOperator *UNUSED(op), const wmE
if (U.ndof_flag & NDOF_ZOOM_INVERT)
zoom_factor = -zoom_factor;
- sima_zoom_set_factor(sima, ar, zoom_factor, NULL);
+ sima_zoom_set_factor(sima, ar, 1.0f + zoom_factor, NULL);
sima->xof += pan_vec[0];
sima->yof += pan_vec[1];