resetPath()v3.3.40
Part of the @remotion/paths package.
Translates an SVG path so that the top-left corner of the bounding box is at 0, 0. Useful for simplifying the math when transforming the coordinates of an SVG path.
reset-path.tsimport {resetPath } from "@remotion/paths"; constnewPath =resetPath ("M 10 10 L 20 20"); // M 0 0 L 10 10
This function will throw if the SVG path is invalid.
Compatibility
| Browsers | Servers | Environments | |||||||
|---|---|---|---|---|---|---|---|---|---|
Chrome | Firefox | Safari | Node.js | Bun | Serverless Functions | ||||