From 9ddbacb4de9239b7c2a9411780d1774e3ff4c6ac Mon Sep 17 00:00:00 2001 From: Yaro Kasear Date: Tue, 9 Dec 2025 11:19:16 -0600 Subject: [PATCH] Update coords box to behave based on grid mode. --- inventory/templates/testing.html | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/inventory/templates/testing.html b/inventory/templates/testing.html index 41e03e6..51114b4 100644 --- a/inventory/templates/testing.html +++ b/inventory/templates/testing.html @@ -511,7 +511,6 @@ gridEl.addEventListener('pointermove', (e) => { const { ix, iy, x: snapX, y: snapY } = snapToGrid(e.clientX, e.clientY); - coordsEl.innerText = `(${ix}, ${iy})`; const renderX = snapX - {{ dot_size }} / 2; const renderY = snapY - {{ dot_size }} / 2; @@ -522,6 +521,19 @@ gridEl.addEventListener('pointermove', (e) => { dotEl.style.top = `${renderY}px`; dotEl.style.left = `${renderX}px`; + const type = getActiveType(); + + var coordsX = `${renderX}px`; + var coordsY = `${renderY}px`; + if (type === 'fullGrid' || type === 'verticalGrid') { + coordsX = `${ix}g`; + } + if (type === 'fullGrid' || type === 'horizontalGrid') { + coordsY = `${iy}g`; + } + + coordsEl.innerText = `(${coordsX}, ${coordsY})`; + if (currentShape) { const tool = currentShape.tool;