fix(ui): F8-07 cargo-route picker — torus-wrap overlay + thinner arrows #63

Merged
developer merged 2 commits from feature/issue-50-cargo-picker-torus into development 2026-05-27 08:08:10 +00:00
Showing only changes of commit 175bf25794 - Show all commits
+17 -6
View File
@@ -280,14 +280,25 @@ Lifecycle (`RendererHandle.setPickMode(opts)`):
1. **Open** (`opts !== null`): renderer marks `pickModeActive`, 1. **Open** (`opts !== null`): renderer marks `pickModeActive`,
sets `alpha = 0.3` on every primitive whose id is neither the sets `alpha = 0.3` on every primitive whose id is neither the
source nor in `reachableIds`, mounts an overlay `Graphics` in source nor in `reachableIds`, mounts one overlay `Graphics`
the origin tile, and subscribes to pointer-move + hover-change per torus copy (nine total — matching the primitive layer's
+ viewport `clicked` + document `keydown`. wrap-copy layout), and subscribes to pointer-move +
hover-change + viewport `clicked` + document `keydown`. In
no-wrap mode the eight non-origin copies are `visible = false`,
so their overlay children render nothing automatically.
2. **Tick** (every pointer-move and hover transition): the 2. **Tick** (every pointer-move and hover transition): the
renderer asks `computePickOverlay(opts, cursorWorld, renderer asks `computePickOverlay(opts, cursorWorld,
hoveredId, points, allIds)` (`src/map/pick-mode.ts`) for a hoveredId, points, allIds, world)` (`src/map/pick-mode.ts`)
draw spec — anchor ring + cursor line + optional hover for a draw spec — anchor ring + cursor line + optional hover
outline + dim set — and re-paints the overlay. outline + dim set — and re-paints every overlay graphic with
the same world-coord ops. Each copy's container already
applies its `(dx*W, dy*H)` transform, so the overlay shows in
whatever tile the user is panned over. In torus mode the
`world` argument switches the cursor-line endpoint to
`(sourceX + torusShortestDelta(...), sourceY + ...)` so the
line takes the short wrap path; anchor and hover-outline
coordinates stay canonical — the per-copy replication renders
them under the user's view in the matching tile.
3. **Resolve**: a click on a primitive whose id is in 3. **Resolve**: a click on a primitive whose id is in
`reachableIds` calls `opts.onPick(id)` and tears down. A click `reachableIds` calls `opts.onPick(id)` and tears down. A click
on empty space or a non-reachable primitive is a no-op on empty space or a non-reachable primitive is a no-op