Fix open paths rendering as closed

Only close a loop path when the last segment ends at the first
segment's start vertex.
This commit is contained in:
Danila Poyarkov 2026-02-28 07:15:07 +03:00
parent b4c7700f05
commit f741eaa296

View file

@ -188,7 +188,11 @@ function addLoopToPath(
for (const segIdx of loop) {
addSegmentToPath(path, segments[segIdx], vertices)
}
path.close()
const lastSeg = segments[loop[loop.length - 1]]
if (lastSeg.end === firstSeg.start) {
path.close()
}
}
function addSegmentToPath(