Skip to content

Commit

Permalink
Fix Curve.reduce
Browse files Browse the repository at this point in the history
  • Loading branch information
baku89 committed Mar 4, 2024
1 parent 4e09b0e commit 40ed523
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Curve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,11 @@ export namespace Curve {
})

if (curve.closed) {
if (vertices.length > 1) {
if (vertices.length === 0) {
if (curve.vertices.length > 0) {
vertices = [curve.vertices[0]]
}
} else if (vertices.length > 1) {
const last = vertices.pop()!
vertices.unshift(last)
}
Expand Down

0 comments on commit 40ed523

Please sign in to comment.