roundedRectPath
The path of a rectangle with a radius per corner, as SVG path data. Each radius is clamped to
half the smaller side, and a radius of 0 gives a square corner (no arc is written).
Available since v3.1.10
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
rect | Rect | The rectangle |
radius | number | readonly [number, number, number, number] | One radius for the four corners, or `[topLeft, topRight, bottomRight, bottomLeft]` as in CSS `border-radius`. Negative radii count as `0` |
Returns
Section titled “Returns”string — The path data, closed
Examples
Section titled “Examples”Round one corner
Section titled “Round one corner”A radius per corner, in CSS order; zero keeps a square corner.
Related Types
Section titled “Related Types”An axis-aligned rectangle: its top-left corner and its size. Width and height are expected to be non-negative.
