feat(m4): playtest friction: perf overlay, fresh import, token seed (#82)
Opt-in ?perf=1 overlay (fps, frame p50/p95, JS p50/p95, tokens, zoom; no node or ticker work when off). fff-vtt import creates and migrates a fresh/empty state dir through the shared server startup path; devbox run serve gains --image. devbox run seed creates deterministic labelled NPC tokens over the real WS (idempotent rerun, --replace), and the GM token form defaults X/Y to the viewport centre.
This commit is contained in:
@@ -71,6 +71,11 @@ export function panCamera(camera: Camera, dx: number, dy: number): Camera {
|
||||
return { ...camera, x: camera.x + dx, y: camera.y + dy }
|
||||
}
|
||||
|
||||
/** The world point at the centre of the viewport: the default position for a new token (#82). */
|
||||
export function viewportCentre(camera: Camera, size: ViewportSize): [number, number] {
|
||||
return screenToWorld(camera, size.width / 2, size.height / 2)
|
||||
}
|
||||
|
||||
/**
|
||||
* Multiply the zoom by `factor` around a screen anchor: the world point under the anchor does not
|
||||
* move, which is what a wheel over the pointer or a pinch between two fingers must feel like.
|
||||
|
||||
Reference in New Issue
Block a user