Skip to main content

resetPath()

Part of the @remotion/paths package. Available from v3.3.40

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.ts
tsx
import { resetPath } from "@remotion/paths";
 
const newPath = resetPath("M 10 10 L 20 20"); // M 0 0 L 10 10
reset-path.ts
tsx
import { resetPath } from "@remotion/paths";
 
const newPath = resetPath("M 10 10 L 20 20"); // M 0 0 L 10 10

This function will throw if the SVG path is invalid.

See also