transformPath
Transforms SVG path data by a matrix. The result is written with absolute M, L, C, Q
and Z only: relative commands are made absolute, H/V/S/T are expanded, and arcs
become cubic curves (so any matrix works, skews included). Moving a path is the common case.
Available since v3.1.10
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
d | string | The path data |
m | Matrix | The matrix, in the CSS/SVG layout |
precision | number | Decimals kept per number. Defaults to `6` |
Returns
Section titled “Returns”string — The transformed path data
Examples
Section titled “Examples”Move a path
Section titled “Move a path”Relative commands are made absolute, then every point is transformed.
Related Types
Section titled “Related Types”Matrix
Section titled “Matrix”A 2D affine transformation, in the layout of CSS and SVG matrix(a, b, c, d, e, f):
