MotionScript

@motion-script/core


@motion-script/core / resolveAnchor

Function: resolveAnchor()

resolveAnchor(value): Vector2

Defined in: attributes/layout/anchor.ts:58

Resolve an Anchor into its normalised [-1, 1] (y-up) Vector2. A named key looks up the table; an explicit vector passes through, which also makes the function idempotent — a resolved value can be re-resolved.

One function, one name: pivot, align, center and anchor props all go through it, so there is a single definition of where 'topRight' is.

Parameters

value

Anchor

Returns

Vector2