From 31f58ade96c2a32cb8951bdbe35b31ae39ce0b72 Mon Sep 17 00:00:00 2001 From: hey24sheep Date: Mon, 13 Sep 2021 22:17:34 +0530 Subject: [PATCH] ctrl zoom feature --- source/viewer/navigation.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/source/viewer/navigation.js b/source/viewer/navigation.js index a4a290d..dcbf9e6 100644 --- a/source/viewer/navigation.js +++ b/source/viewer/navigation.js @@ -396,7 +396,15 @@ OV.Navigation = class let moveDiff = this.mouse.GetMoveDiff (); let mouseButton = this.mouse.GetButton (); - if (mouseButton === 1) { + 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; + } + this.Zoom(ratio); + } else if (mouseButton === 1) { let orbitRatio = 0.5; this.Orbit (moveDiff.x * orbitRatio, moveDiff.y * orbitRatio); } else if (mouseButton === 2 || mouseButton === 3) {