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 <campbell@blender.org>2022-10-07 09:44:17 +0300
committerCampbell Barton <campbell@blender.org>2022-10-07 09:46:25 +0300
commitfc0b1627ebb821b1897cbca7f6ba9be29e52359a (patch)
tree51dbd495bb65d32fe8c528cde757aed0eb654bc1
parent3522c6e59c34a1ed6143840c250e1b7b446b8a4e (diff)
Fix T100953: Zooming with NDOF is inverted in the camera view
Use convention for applying zoom in other 2D views.
-rw-r--r--source/blender/editors/space_view3d/view3d_navigate_ndof.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/editors/space_view3d/view3d_navigate_ndof.c b/source/blender/editors/space_view3d/view3d_navigate_ndof.c
index 22b3a4b968e..893c9008f23 100644
--- a/source/blender/editors/space_view3d/view3d_navigate_ndof.c
+++ b/source/blender/editors/space_view3d/view3d_navigate_ndof.c
@@ -376,6 +376,9 @@ static int view3d_ndof_cameraview_pan_zoom(bContext *C, const wmEvent *event)
float pan_vec[3];
WM_event_ndof_pan_get(ndof, pan_vec, true);
+ mul_v2_fl(pan_vec, ndof->dt);
+ pan_vec[2] *= -ndof->dt;
+
/* NOTE(@campbellbarton): In principle rotating could pass through to regular
* non-camera NDOF behavior (exiting the camera-view and rotating).
* Disabled this block since in practice it's difficult to control NDOF devices
@@ -390,7 +393,7 @@ static int view3d_ndof_cameraview_pan_zoom(bContext *C, const wmEvent *event)
bool changed = false;
if (has_translate) {
- const float speed = ndof->dt * NDOF_PIXELS_PER_SECOND;
+ const float speed = NDOF_PIXELS_PER_SECOND;
float event_ofs[2] = {pan_vec[0] * speed, pan_vec[1] * speed};
if (ED_view3d_camera_view_pan(region, event_ofs)) {
changed = true;
@@ -398,7 +401,7 @@ static int view3d_ndof_cameraview_pan_zoom(bContext *C, const wmEvent *event)
}
if (has_zoom) {
- const float scale = 1.0f + (ndof->dt * pan_vec[2]);
+ const float scale = 1.0f + pan_vec[2];
if (ED_view3d_camera_view_zoom_scale(rv3d, scale)) {
changed = true;
}