diff --git a/ui/docs/renderer.md b/ui/docs/renderer.md index dbcfb47..78c011c 100644 --- a/ui/docs/renderer.md +++ b/ui/docs/renderer.md @@ -280,14 +280,25 @@ Lifecycle (`RendererHandle.setPickMode(opts)`): 1. **Open** (`opts !== null`): renderer marks `pickModeActive`, sets `alpha = 0.3` on every primitive whose id is neither the - source nor in `reachableIds`, mounts an overlay `Graphics` in - the origin tile, and subscribes to pointer-move + hover-change - + viewport `clicked` + document `keydown`. + source nor in `reachableIds`, mounts one overlay `Graphics` + per torus copy (nine total — matching the primitive layer's + 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 renderer asks `computePickOverlay(opts, cursorWorld, - hoveredId, points, allIds)` (`src/map/pick-mode.ts`) for a - draw spec — anchor ring + cursor line + optional hover - outline + dim set — and re-paints the overlay. + hoveredId, points, allIds, world)` (`src/map/pick-mode.ts`) + for a draw spec — anchor ring + cursor line + optional hover + 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 `reachableIds` calls `opts.onPick(id)` and tears down. A click on empty space or a non-reachable primitive is a no-op