Web Dev Solutions

Catalin Mititiuc

From 1b1a809178ecb4e4ae0f2204c441f4c2921b7785 Mon Sep 17 00:00:00 2001 From: Catalin Mititiuc Date: Sat, 8 Jun 2024 11:17:40 -0700 Subject: WIP: Fix pan-zoom for webkit --- src/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/index.js') diff --git a/src/index.js b/src/index.js index 87c9bfb..c7e040a 100644 --- a/src/index.js +++ b/src/index.js @@ -131,7 +131,7 @@ async function buildScenario(req) { }); }); - scenario.querySelectorAll('use.mapsheet').forEach(el => gb.prepend(svg.ownerDocument.importNode(el, true))); + scenario.querySelectorAll('use.mapsheet').forEach(el => gb.querySelector('#background').after(svg.ownerDocument.importNode(el, true))); if (startLocs) grid.before(svg.ownerDocument.importNode(startLocs, true)); const scenarioGrid = scenario.querySelector('.grid'); @@ -174,6 +174,12 @@ async function buildScenario(req) { panzoom.start(svg); gameboard.start(svg); recordSheet.start(startLocs, gameboard.getUnits()); + + const mapContainer = document.querySelector('#map-container'); + const mapContainerRect = mapContainer.getBoundingClientRect(); + + console.log('mapContainer', mapContainer); + console.log('mapContainerRect', mapContainerRect); } function updateTurnCounter() { -- cgit v1.2.3