Skip to content

1681-engine / ui / snapRect

Function: snapRect() ​

ts
function snapRect(r, on?): Rect;

Defined in: src/ui/layout/geometry.ts:44

A rect with its edges (not its size) rounded: two neighbours that touch before snapping still touch after, where rounding x and width apart could open or overlap a pixel between them.

Parameters ​

ParameterTypeDefault value
rRectundefined
onbooleantrue

Returns ​

Rect

Released under the MIT License.