disable zoom on movement along x-axis

This commit is contained in:
hey24sheep 2021-09-16 16:38:53 +05:30
parent a2061a7ca6
commit 089f4a0fc9

View File

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