🎥 Make videos programmatically with React
Update split-segment.ts
Jonny Burgera2f3df0a7bf7
diff --git a/packages/paths/src/interpolate-path/split-segment.ts b/packages/paths/src/interpolate-path/split-segment.tsindex 8e93a1dae1..44a4825a7e 100644--- a/packages/paths/src/interpolate-path/split-segment.ts+++ b/packages/paths/src/interpolate-path/split-segment.ts@@ -14,6 +14,8 @@ import {splitCurve} from './split-curve';* @return {Object[]} Array of ~segmentCount command objects between commandStart and* commandEnd. (Can be segmentCount+1 objects if commandStart is type M).*/++// TODO: Delete and replaceexport function splitSegment(commandStart: Command,commandEnd: Command,@@ -27,9 +29,16 @@ export function splitSegment(commandEnd.type === 'Q' ||commandEnd.type === 'C') {- segments = segments.concat(- splitCurve(commandStart, commandEnd, segmentCount),- );+ if (commandStart.type !== 'Z') {+ segments = segments.concat(+ splitCurve(+ commandStart.x as number,+ commandStart.y as number,+ commandEnd,+ segmentCount,+ ),+ );+ }// general case - just copy the same point} else {