MotionScript

@motion-script/core


@motion-script/core / resolveShapePivot

Function: resolveShapePivot()

resolveShapePivot(pivot): Vector2

Defined in: render/descriptors/shape.ts:32

Normalise a per-shape pivot input to a Vector2. Resolves a named anchor ('topRight', …) to its normalised [-1, 1] pivot and passes an explicit Vector2 through. Idempotent — safe to call on already-resolved state — so both with*Descriptor and the renderer can call it. Defaults to centre when the pivot is absent.

Parameters

pivot

Anchor | undefined

Returns

Vector2