From b76cb71f37b289542d2762dc143824357f3a13eb Mon Sep 17 00:00:00 2001 From: Catalin Constantin Mititiuc Date: Mon, 16 Jun 2025 22:41:34 -0700 Subject: [PATCH] Auto-pan to center of counter --- node_modules/pan-zoom/src/modules/pan.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node_modules/pan-zoom/src/modules/pan.js b/node_modules/pan-zoom/src/modules/pan.js index 596d41a..428f4b4 100644 --- a/node_modules/pan-zoom/src/modules/pan.js +++ b/node_modules/pan-zoom/src/modules/pan.js @@ -27,7 +27,7 @@ export function manualPan(gb, counter) { const counterRect = counter.getBoundingClientRect(); const mapRect = document.querySelector('object').getBoundingClientRect(); - let startPt = new DOMPoint(counterRect.x, counterRect.y); + let startPt = new DOMPoint(counterRect.x + counterRect.width / 2, counterRect.y + counterRect.height / 2); let movePt = new DOMPoint(mapRect.width / 2, mapRect.height / 2); startPt = startPt.matrixTransform(inverseScreenCTM);