Function: screenToLayout()
ts
function screenToLayout(
layout,
box,
clientX,
clientY
): Vec;Convert a screen point (e.g. a pointer event's clientX, clientY) to layout units, given the box of the element the layout fills: a <TileLayout> container, an <svg> with the layout's viewBox, or a canvas you drew it on. Like SVG's default preserveAspectRatio, the layout is taken to be scaled to fit the box and centerd.
Parameters
| Parameter | Type |
|---|---|
layout | Layout |
box | ScreenBox |
clientX | number |
clientY | number |