Skip to content

Commit fa424aa

Browse files
committed
Fix - Filter out null datapoints when creating a smooth path
1 parent aefe95d commit fa424aa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ export function createSmoothPath(points) {
586586
const cpe = controlPoint(point, a[i - 1], a[i + 1], true);
587587
return `C ${cps.x},${cps.y} ${cpe.x},${cpe.y} ${point.x},${point.y}`;
588588
}
589-
const d = points.reduce((acc, point, i, a) => i === 0
589+
const d = points.filter(p => !!p).reduce((acc, point, i, a) => i === 0
590590
? `${point.x},${point.y} `
591591
: `${acc} ${bezierCommand(point, i, a)} `
592592
, '');

0 commit comments

Comments
 (0)