Skip to main content

Camera and coordinates

Pan, zoom, viewport measurements, and board-space conversion.

The camera stores translation x, y, and zoom z. Nodes remain in board coordinates. BoardRoot applies the camera transform and owns viewport measurement.

Use engine camera commands such as panBy, zoomTo, and zoomToFit. Use the exported math helpers when application UI must convert between screen and board space.

Viewport size is runtime session state because it depends on the mounted DOM. It does not belong in the persisted JSON Canvas document.

Rendering can derive visible bounds from the camera and viewport, then cull nodes outside the margin. Camera changes publish through their focused subscribable and events.