Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCatalin Mititiuc <webdevcat@proton.me>2024-07-28 14:36:56 -0700
committerCatalin Mititiuc <webdevcat@proton.me>2024-07-28 14:36:56 -0700
commite746cfb216836e26a6c060558278d724bd3ed5d5 (patch)
tree394bc3919bab295f9a22128d8aee39555a35f3aa /src/modules/pan-zoom.js
parentd75fb0b37c7dbfb58b14f563b1dc3fb2a73305b7 (diff)
Add clear hex contents dialog
Diffstat (limited to 'src/modules/pan-zoom.js')
-rw-r--r--src/modules/pan-zoom.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/modules/pan-zoom.js b/src/modules/pan-zoom.js
index 11471f6..d13c90f 100644
--- a/src/modules/pan-zoom.js
+++ b/src/modules/pan-zoom.js
@@ -14,8 +14,10 @@ function restorePanZoomVal(el) {
function addEventListeners(svg, el) {
svg.addEventListener('wheel', e => zoom(el, e, zoomFactor), { passive: false });
svg.addEventListener('pointerdown', e => {
- e.target.setPointerCapture(e.pointerId);
- pan(svg, el, e), { passive: false };
+ if (e.button === 0) {
+ e.target.setPointerCapture(e.pointerId);
+ pan(svg, el, e), { passive: false };
+ }
});
}