Skip to content

Intermact API Reference / @intermact/render-r3f / computeFit

Function: computeFit() ​

computeFit(domain, fit, width, height): FitResult

Defined in: render-r3f/src/fit.ts:23

Compute the orthographic frustum that maps a scene domain into a pixel viewport under a fit strategy (design.md §9, §10): contain letterboxes, cover crops to fill, stretch matches the domain exactly (may distort).

Parameters ​

domain ​

x ​

Interval

y ​

Interval

fit ​

NonNullable<"contain" | "cover" | "stretch" | undefined>

width ​

number

height ​

number

Returns ​

FitResult

Intermact v1.0 — 文档覆盖 Phase-1 / Phase-2 / Phase-3(全阶段)