Skip to content

Function: resolveRootTransform() ​

resolveRootTransform(box, width, height, placement): SsRootTransform

Defined in: packages/react-native-spritestudio/src/core/fit.ts:101

The root transform that puts box into a width x height view.

React-free and Skia-free so both Layer 4 components share exactly one copy of this arithmetic, and so it can be checked without a renderer.

A zero-sized or absent box means "nothing to fit": the fit is skipped and the result is the pre-fit behaviour — scale 1, origin at the view's centre — rather than a division by zero.

Parameters ​

box ​

SsBox | null | undefined

width ​

number

height ​

number

placement ​

SsPlacement

Returns ​

SsRootTransform