---
url: https://cri-middleware.github.io/SSPlayerForReactNative/api/functions/resolveRootTransform.md
---
# Function: resolveRootTransform()

> **resolveRootTransform**(`box`, `width`, `height`, `placement`): [`SsRootTransform`](../interfaces/SsRootTransform.md)

Defined in: [packages/react-native-spritestudio/src/core/fit.ts:101](https://github.com/cri-middleware/SSPlayerForReactNative/blob/ddb0878ad347fd4a411e4e2eb0829a948cb07ff8/packages/react-native-spritestudio/src/core/fit.ts#L101)

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`](../interfaces/SsBox.md) | `null` | `undefined`

### width

`number`

### height

`number`

### placement

[`SsPlacement`](../interfaces/SsPlacement.md)

## Returns

[`SsRootTransform`](../interfaces/SsRootTransform.md)
