From 8a744362ff9a454d284b1385a7b30cce98271bfb Mon Sep 17 00:00:00 2001 From: dax Date: Tue, 4 Aug 2026 11:22:41 +0000 Subject: mouse keeps selection control until an explicit scroll; drags pan without re-selecting --- public/app.js | 10 ++++++++-- public/index.html | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/public/app.js b/public/app.js index a80623f..cce9bc8 100644 --- a/public/app.js +++ b/public/app.js @@ -328,6 +328,7 @@ function adjacentTile(id, dir) { } function traverseFrom(id, dir) { + followEnabled = false const back = adjacentTile(id, dir) if (back) { hideGhost() @@ -453,6 +454,7 @@ function refreshPreviews() { } let lastFollow = 0 +let followEnabled = true function followCurrent() { if (!tiles.size || !cur) return const cx = (window.innerWidth / 2 - panX) / scale @@ -482,7 +484,7 @@ function maybeFollow() { if (now - lastFollow < 200) return lastFollow = now const before = cur && cur.id - followCurrent() + if (followEnabled) followCurrent() if (cur && cur.id === before) refreshPreviews() } @@ -501,11 +503,13 @@ stage.addEventListener("pointerdown", (e) => { hideGhost() world.style.transition = "none" if (pointers.size === 2) { + followEnabled = true drag = null const [a, b] = [...pointers.values()] pinchDist = Math.hypot(b.x - a.x, b.y - a.y) return } + followEnabled = false drag = { x: e.clientX, y: e.clientY, px: panX, py: panY, moved: false, tile: e.target.closest(".tile") } }) @@ -548,11 +552,12 @@ stage.addEventListener("pointerup", (e) => { drag = null world.style.transition = "" if (wasDrag || !tile) { - if (wasDrag) followCurrent() + if (wasDrag && followEnabled) followCurrent() if (!wasDrag && !tile && e.pointerType === "touch") bgTap() return } const id = Number(tile.dataset.id) + followEnabled = false if (cur && cur.id === id) return setCurrent(id, tiles.get(id).rect) }) @@ -578,6 +583,7 @@ function bgTap() { let zoomTimer = 0 stage.addEventListener("wheel", (e) => { e.preventDefault() + followEnabled = true let dx = e.deltaX let dy = e.deltaY if (e.deltaMode === 1) { dx *= 16; dy *= 16 } diff --git a/public/index.html b/public/index.html index 2e4f8c1..1514600 100644 --- a/public/index.html +++ b/public/index.html @@ -5,7 +5,7 @@ pathways - +
@@ -16,6 +16,6 @@

four paths, one per direction. walk them.

- + -- cgit v1.3.1