Derive a View that fits the chosen world rect into a minimap of
dims.width × dims.height CSS px. Uniform scale on both axes; the rect
is centered with padding (default 8) on each side. The smaller-axis
fit ratio wins, so the whole rect is visible.
fit === "scene": union AABB of leaf-node poses via poseBounds.
Empty scene → FALLBACK_FIT_VIEW.
fit is { kind: "world", rect }: fit rect. A degenerate rect
(zero or negative area) falls back to identity scale centered on the
rect's top-left — we don't divide by zero.
fit is a function: called with (scene, dims); its return is
passed through unchanged.
Derive a
Viewthat fits the chosen world rect into a minimap ofdims.width × dims.heightCSS px. Uniform scale on both axes; the rect is centered withpadding(default 8) on each side. The smaller-axis fit ratio wins, so the whole rect is visible.fit === "scene": union AABB of leaf-node poses viaposeBounds. Empty scene → FALLBACK_FIT_VIEW.fitis{ kind: "world", rect }: fitrect. A degenerate rect (zero or negative area) falls back to identity scale centered on the rect's top-left — we don't divide by zero.fitis a function: called with(scene, dims); its return is passed through unchanged.