diff --git a/js/ui/tool/dream.js b/js/ui/tool/dream.js index 5bdb277..b466e33 100644 --- a/js/ui/tool/dream.js +++ b/js/ui/tool/dream.js @@ -806,9 +806,13 @@ const _reticle_draw = (evn, state, tool, style = {}) => { const _dream_onwheel = (evn, state) => { if (!evn.evn.ctrlKey) { - const v = - state.cursorSize - - Math.floor(state.config.cursorSizeScrollSpeed * evn.delta); + // Seems mouse wheel scroll is very different between different browsers. + // Will use scroll as just an event to go to the next cursor snap position instead. + // + // TODO: Someone that has a smooth scrolling mouse should verify if this works with them. + + const v = state.cursorSize - 128 * (evn.delta / Math.abs(evn.delta)); + state.cursorSize = state.setCursorSize(v + snap(v, 0, 128)); state.mousemovecb(evn); } diff --git a/js/ui/tool/interrogate.js b/js/ui/tool/interrogate.js index 8425ac9..5e97375 100644 --- a/js/ui/tool/interrogate.js +++ b/js/ui/tool/interrogate.js @@ -48,8 +48,16 @@ const interrogateTool = () => reticleStyle: "#AFAF", }); }; + + state.redraw = () => { + state.mousemovecb({ + x: mouse.coords.world.pos.x, + y: mouse.coords.world.pos.y, + }); + }; + state.wheelcb = (evn) => { - _interrogate_onwheel(evn, state); + _dream_onwheel(evn, state); }; state.interrogatecb = (evn) => { @@ -91,20 +99,6 @@ const interrogateTool = () => } ); -/** - * Generic wheel handler - */ - -const _interrogate_onwheel = (evn, state) => { - if (!evn.evn.ctrlKey) { - const v = - state.cursorSize - - Math.floor(state.config.cursorSizeScrollSpeed * evn.delta); - state.cursorSize = state.setCursorSize(v + snap(v, 0, 128)); - state.mousemovecb(evn); - } -}; - const interrogate_callback = async (evn, state) => { const bb = getBoundingBox( evn.x,