(
loc: NonNullable<ReturnType<typeof locateAnimation>>,
waypoints: Array<{ x: number; y: number }>,
segments: ArcPathSegment[],
autoRotate: boolean | number,
)
| 2947 | } |
| 2948 | |
| 2949 | function writeMotionPathValue( |
| 2950 | loc: NonNullable<ReturnType<typeof locateAnimation>>, |
| 2951 | waypoints: Array<{ x: number; y: number }>, |
| 2952 | segments: ArcPathSegment[], |
| 2953 | autoRotate: boolean | number, |
| 2954 | ): string { |
| 2955 | const motionPathCode = buildMotionPathObjectCode({ waypoints, segments, autoRotate }); |
| 2956 | const varsArg = loc.target.call.varsArg; |
| 2957 | const existingProp = varsArg.properties.find( |
| 2958 | (p: AstNode) => isObjectProperty(p) && propKeyName(p) === "motionPath", |
| 2959 | ); |
| 2960 | if (existingProp) existingProp.value = parseExpr(motionPathCode); |
| 2961 | return recast.print(loc.parsed.ast).code; |
| 2962 | } |
| 2963 | |
| 2964 | /** |
| 2965 | * Insert a waypoint at `index` (between existing anchors), splitting the segment |
no test coverage detected