diff --git a/ui/PLAN.md b/ui/PLAN.md index 434921a..2b0599e 100644 --- a/ui/PLAN.md +++ b/ui/PLAN.md @@ -952,9 +952,9 @@ Targeted tests (delivered): invitation removes card and adds the game to My Games. Phase 7 auth flow now also runs over the FlatBuffers wire. -## ~~Phase 9. Map Renderer with Fixture Data~~ +## Phase 9. Map Renderer with Fixture Data -Status: done. +Status: pending. Goal: stand up the PixiJS map renderer with pan/zoom, primitive drawing, torus wrap behaviour and bounded-plane (no-wrap) mode against diff --git a/ui/frontend/src/routes/__debug/map/+page.svelte b/ui/frontend/src/routes/__debug/map/+page.svelte index ae1b268..a201fcb 100644 --- a/ui/frontend/src/routes/__debug/map/+page.svelte +++ b/ui/frontend/src/routes/__debug/map/+page.svelte @@ -3,6 +3,7 @@ import { page } from "$app/state"; import { createRenderer, + minScaleNoWrap, sampleWorld, type RendererHandle, type RendererPreference, @@ -60,12 +61,13 @@ } backend = handle.getBackend(); - // Initial camera: place world centre. + // Initial camera: world centre, zoomed slightly past the + // fits-the-viewport floor so neighbouring torus copies are + // visible too. handle.viewport.moveCenter(world.width / 2, world.height / 2); - // Initial zoom: fit-ish (slight zoom-in from minScale). - const minScale = Math.max( - containerEl.clientWidth / world.width, - containerEl.clientHeight / world.height, + const minScale = minScaleNoWrap( + { widthPx: containerEl.clientWidth, heightPx: containerEl.clientHeight }, + world, ); handle.viewport.setZoom(minScale * 1.2, true); if (mode === "no-wrap") handle.setMode("no-wrap"); // re-clamp post zoom