resetPath()
属于@remotion/paths
包。从v3.3.40版本开始可用
将SVG路径转换,使得bounding box的左上角位于0, 0
。在转换SVG路径的坐标时,简化数学运算时非常有用。
reset-path.tstsx
import {resetPath } from "@remotion/paths";constnewPath =resetPath ("M 10 10 L 20 20"); // M 0 0 L 10 10
reset-path.tstsx
import {resetPath } from "@remotion/paths";constnewPath =resetPath ("M 10 10 L 20 20"); // M 0 0 L 10 10
如果SVG路径无效,此函数将抛出异常。