aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordax <me@dax.ist>2026-08-05 09:49:37 +0100
committerdax <me@dax.ist>2026-08-05 09:49:37 +0100
commit3eb6e48a22ac38d3886f4572f2ada1fdbba4f106 (patch)
tree3ce4eec7262dfd8d065991422a17401927b970e9
parenta3a42955ba57a6ae052c7d49d58623e0ed04d653 (diff)
suppress prospective ghost after click/scroll/zoom until real pointer movement, so pans can't reveal a ghost under a stationary mouse
-rw-r--r--public/app.js7
-rw-r--r--public/index.html4
2 files changed, 8 insertions, 3 deletions
diff --git a/public/app.js b/public/app.js
index ed1c6d6..9c6d187 100644
--- a/public/app.js
+++ b/public/app.js
@@ -35,6 +35,7 @@ let scale = 1
let userZoomed = false
let drag = null
let hoveredSlot = null
+let suppressHover = false
const TOUCH = typeof window.matchMedia === "function" && window.matchMedia("(hover: none)").matches
@@ -199,6 +200,7 @@ function setCurrent(id, rect, recenter = true) {
if (!userZoomed) scale = worldScale()
center()
hoveredSlot = null
+ suppressHover = true
}
getExits(id)
if (prevId && prevId !== id) renderNav(prevId)
@@ -239,7 +241,7 @@ async function getExits(id) {
const exits = data.exits || []
exitsCache.set(id, exits)
renderNav(id)
- if (!drag) {
+ if (!drag && !suppressHover) {
const s = findSlotAt(lastCursor.wx, lastCursor.wy)
if (s) { hoveredSlot = s; refreshPreviews() }
}
@@ -478,6 +480,7 @@ stage.addEventListener("pointerdown", (e) => {
pointers.set(e.pointerId, { x: e.clientX, y: e.clientY })
try { stage.setPointerCapture(e.pointerId) } catch { /* ignore */ }
hoveredSlot = null
+ suppressHover = true
hideSlot()
world.style.transition = "none"
if (pointers.size === 2) {
@@ -494,6 +497,7 @@ stage.addEventListener("pointerdown", (e) => {
stage.addEventListener("pointermove", (e) => {
lastCursor.wx = (e.clientX - panX) / scale
lastCursor.wy = (e.clientY - panY) / scale
+ suppressHover = false
if (pointers.has(e.pointerId)) {
pointers.set(e.pointerId, { x: e.clientX, y: e.clientY })
if (pointers.size === 2 && pinchDist > 0) {
@@ -578,6 +582,7 @@ stage.addEventListener("wheel", (e) => {
if (e.deltaMode === 1) { dx *= 16; dy *= 16 }
else if (e.deltaMode === 2) { dx *= window.innerWidth; dy *= window.innerHeight }
world.style.transition = "none"
+ suppressHover = true
if (e.ctrlKey) {
hoveredSlot = null
hideSlot()
diff --git a/public/index.html b/public/index.html
index 5746273..67368cb 100644
--- a/public/index.html
+++ b/public/index.html
@@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="color-scheme" content="dark">
<title>pathways</title>
- <link rel="stylesheet" href="/app.css?v=58">
+ <link rel="stylesheet" href="/app.css?v=59">
</head>
<body>
<main id="stage">
@@ -29,6 +29,6 @@
<span id="progress-text"></span>
</div>
<div id="toast" role="status" aria-live="polite"></div>
- <script src="/app.js?v=58"></script>
+ <script src="/app.js?v=59"></script>
</body>
</html>