1681-engine / ui / anchorPosition
Function: anchorPosition() ​
ts
function anchorPosition(
anchor,
size,
viewport,
margin?,
snap?
): Point;Defined in: src/ui/layout/anchor.ts:23
Top-left of a box of size pinned to anchor of the viewport, margin in from the edges (a number, or per side for a phone's notch). Centred anchors ignore the margins of the sides they do not touch.
Parameters ​
| Parameter | Type | Default value |
|---|---|---|
anchor | ScreenAnchor | undefined |
size | Size | undefined |
viewport | Size | undefined |
margin | number | Partial<Insets> | 0 |
snap | boolean | false |