scalePath()v3.3.43
Part of the @remotion/paths package.
Allows you to grow or shrink the size of a path.
scale-path.tsimport {scalePath } from "@remotion/paths"; constnewPath =scalePath ("M 0 0 L 100 100", 1, 2); // "M 0 0 L 100 200";
The origin of the transform is the top left corner of the path. To use a different origin, first use translatePath() to move the path to the desired origin, then scale it, and finally move it back to the original origin.
Arguments
path
string
A valid SVG Path string.
xScale
number
The factor of which to scale the path horizontally. 1 will leave the path unchanged.
yScale
number
The factor of which to scale the path vertically. 1 will leave the path unchanged.
Compatibility
| Browsers | Servers | Environments | |||||||
|---|---|---|---|---|---|---|---|---|---|
Chrome | Firefox | Safari | Node.js | Bun | Serverless Functions | ||||