Zoom evenly at a sensible rate

This commit is contained in:
Brandon Dyck 2024-07-22 15:18:56 -06:00
parent 8ed3a93fbb
commit 62aa9edc14

View File

@ -186,7 +186,7 @@
let zoom = 3; let zoom = 3;
viewer.addEventListener("wheel", (evt) => { viewer.addEventListener("wheel", (evt) => {
console.log(evt.deltaY); console.log(evt.deltaY);
zoom = Math.max(zoom + evt.deltaY * 0.75, minZoom); zoom = Math.max(zoom * (1 - evt.deltaY * 0.005), minZoom);
evt.preventDefault(); evt.preventDefault();
}); });