Back to Remotion

resetPath()

packages/docs/docs/paths/reset-path.mdx

4.0.463652 B
Original Source

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.

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