Skip to content

Commit b1f360c

Browse files
committed
fix race condition that produced broken triangulation
closes #13
1 parent 3a61ecc commit b1f360c

File tree

2 files changed

+53
-24
lines changed

2 files changed

+53
-24
lines changed

index.js

+2
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,8 @@ export default class Delaunator {
246246
const ar = a0 + (a + 2) % 3;
247247
const bl = b0 + (b + 2) % 3;
248248

249+
if (b === -1) return ar;
250+
249251
const p0 = triangles[ar];
250252
const pr = triangles[a];
251253
const pl = triangles[al];

0 commit comments

Comments
 (0)