X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=Automap%2FMapSRC%2Fsrc%2Findex.js;h=55abc93de6754acb12055947060096875ed40ee7;hb=ad682e7cf674fd298acefd562fd3787dbaa1f07d;hp=5b8dc9e73e2f38f5b2a9bd861fb1ba884f36f9b1;hpb=7ee9d3ca4ad7b6b39dce2979e13ad1ca8a1ab1e7;p=automap%2Fautomap.git diff --git a/Automap/MapSRC/src/index.js b/Automap/MapSRC/src/index.js index 5b8dc9e..55abc93 100644 --- a/Automap/MapSRC/src/index.js +++ b/Automap/MapSRC/src/index.js @@ -25,7 +25,6 @@ vf.reloadChunkList(); }); }()); - // #### CONTROLS #### // hovering (function () { @@ -49,10 +48,17 @@ vf.reloadChunkList(); var id; vf.map.canvas.addEventListener('wheel', event => { clearTimeout(id); - vf.zoom += -Math.sign(event.deltaY)*2; id = setTimeout(() => { vf.render(); }, 250); + // this makes it so zooming out is faster + let dir = -Math.sign(event.deltaY); + if (vf.zoom < 16) // arbitrary value + vf.zoom += dir; + else + vf.zoom += dir * 4; + if (vf.zoom <= 0) + vf.zoom += 1; // make sure it doesnt go to negative values }); }());