From 40ed5235d32870c337165cdc32ed1d5824e3105f Mon Sep 17 00:00:00 2001 From: Baku Hashimoto Date: Mon, 4 Mar 2024 13:23:38 +0900 Subject: [PATCH] Fix Curve.reduce --- src/Curve.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Curve.ts b/src/Curve.ts index 4d7983a..543c992 100644 --- a/src/Curve.ts +++ b/src/Curve.ts @@ -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) }