ctrl zoom feature

This commit is contained in:
hey24sheep 2021-09-13 22:17:34 +05:30
parent b89a3429ba
commit 31f58ade96

View File

@ -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) {