index : btroops | |
Virtual board game-aid for BattleTroops, an infantry combat simulator wargame published by FASA in 1989. |
aboutsummaryrefslogtreecommitdiff |
diff options
Diffstat (limited to 'src/modules/pan-zoom.js')
-rw-r--r-- | src/modules/pan-zoom.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/modules/pan-zoom.js b/src/modules/pan-zoom.js index 86f6727..3818444 100644 --- a/src/modules/pan-zoom.js +++ b/src/modules/pan-zoom.js @@ -12,8 +12,13 @@ function restorePanZoomVal(svg) { } function addEventListeners(svg) { - svg.addEventListener('wheel', e => zoom(svg, e, zoomFactor), { passive: false }); - svg.addEventListener('pointerdown', e => pan(svg, e), { passive: false }); + // svg.addEventListener('wheel', e => zoom(svg, e, zoomFactor), { passive: false }); + // svg.addEventListener('pointerdown', e => pan(svg, e), { passive: false }); + + const group = svg.querySelector('.gameboard'); + + svg.addEventListener('wheel', e => zoom(group, e, zoomFactor), { passive: false }); + svg.addEventListener('pointerdown', e => pan(svg, group, e), { passive: false }); } function storePanZoomVal(transformMatrix) { |