From 089f4a0fc92edb918ae500b3ac92a7277af93497 Mon Sep 17 00:00:00 2001 From: hey24sheep Date: Thu, 16 Sep 2021 16:38:53 +0530 Subject: [PATCH] disable zoom on movement along x-axis --- source/viewer/navigation.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/source/viewer/navigation.js b/source/viewer/navigation.js index dcbf9e6..dc336cb 100644 --- a/source/viewer/navigation.js +++ b/source/viewer/navigation.js @@ -398,12 +398,14 @@ OV.Navigation = class let mouseButton = this.mouse.GetButton (); if (mouseButton === 1 && ev.ctrlKey) { let params = ev || window.event; - let delta = -params.movementY / 40; - let ratio = 0.01; - if (delta < 0) { - ratio = ratio * -1.0; + if (params.movementX === 0) { + let delta = -params.movementY / 40; + let ratio = 0.02; + if (delta < 0) { + ratio = ratio * -1.0; + } + this.Zoom(ratio); } - this.Zoom(ratio); } else if (mouseButton === 1) { let orbitRatio = 0.5; this.Orbit (moveDiff.x * orbitRatio, moveDiff.y * orbitRatio);