Skip to content

Commit

Permalink
Fix #7.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Mar 20, 2018
1 parent 10d6fd7 commit cd6c1f0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/voronoi.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ export default class Voronoi {
}
for (let i = 0, m = halfedges.length; i < m; ++i) {
const j = halfedges[i];
if (j < 0) continue;
cells[triangles[i]]._connect(Math.floor(i / 3), Math.floor(j / 3));
const cell = cells[triangles[i]];
if (j < 0) {
if (!cell.triangles.length) cell.triangles.push([Math.floor(i / 3)]);
continue;
}
cell._connect(Math.floor(i / 3), Math.floor(j / 3));
}

// Compute circumcenters.
Expand Down

0 comments on commit cd6c1f0

Please sign in to comment.