anchorToPoint

Commons
stable

Convert a parsed anchor descriptor (side + align) into an absolute viewport-space point relative to the given bounding box.

API

Signature

Signature TypeScript complète, extraite du fichier util.

typescript

API

Paramètres

Paramètres d'entrée acceptés par cet util.

anchor
requis
TParsedAnchor
A parsed anchor object with a side (top | bottom | left | right) and an align value specifying the cross-axis position.
box
requis
IBox
The bounding box (x, y, width, height) of the reference element.

API

Valeur de retour

La valeur retournée par cet util.

A viewport-space {x, y} coordinate at the computed anchor position on the bounding box.

Usage

Exemples

Extraits de code prêts à coller.

Convert a top-center anchor to a point

typescript