Open shemetz opened 1 year ago
Quoting from discord:
you are overriding MouseManager.prototype._onWheel my module just sets the events for the canvas
Hooks.on('canvasReady', (canvas)=>{ canvas._onMouseWheel = function(event) { if ( event.altKey) { let degrees = 5; if (event.ctrlKey) degrees = 15; if (event.shiftKey) degrees = 45; canvas.stage.rotation = (event.delta < 0 ? (canvas.stage.rotation + Math.toRadians(degrees)) : (canvas.stage.rotation - Math.toRadians(degrees))) % (2*Math.PI); canvas.hud.align(); Hooks.call('canvasPan', canvas, {}); return; } let dz = ( event.delta < 0 ) ? 1.05 : 0.95; this.pan({scale: dz * canvas.stage.scale.x}); } canvas.hud.align = function() { const hud = this.element[0]; const {x, y} = canvas.primary.getGlobalPosition(); const scale = canvas.stage.scale.x; hud.style.left = `${x}px`; hud.style.top = `${y}px`; hud.style.transform = `scale(${scale}) rotate(${Math.round(Math.toDegrees(canvas.stage.rotation)/5)*5}deg)`; } });
I think your override prevents the event from ever reaching the canvas
link to the other module link: https://github.com/xaukael/card-tokens
Quoting from discord:
you are overriding MouseManager.prototype._onWheel my module just sets the events for the canvas
I think your override prevents the event from ever reaching the canvas