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.
API
Paramètres
Paramètres d'entrée acceptés par cet util.
- anchorrequisTParsedAnchor
- A parsed anchor object with a side (top | bottom | left | right) and an align value specifying the cross-axis position.
- boxrequisIBox
- 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