Skip to content

Commit

Permalink
Don’t yield null cells.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed May 23, 2018
1 parent 59f4878 commit e641963
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/voronoi.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ export default class Voronoi {
*cellPolygons() {
const {delaunay: {points}} = this;
for (let i = 0, n = points.length / 2; i < n; ++i) {
yield this.cellPolygon(i);
const cell = this.cellPolygon(i);
if (cell) yield cell;
}
}
cellPolygon(i) {
Expand Down

0 comments on commit e641963

Please sign in to comment.