Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/cover.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function(x, y) {

// Otherwise, double repeatedly to cover.
else {
var z = x1 - x0,
var z = x1 - x0 || 1,
node = this._root,
parent,
i;
Expand Down
5 changes: 5 additions & 0 deletions test/cover-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,8 @@ tape("quadtree.cover(x, y) does not wrap the root node if it is undefined", func
test.equal(q.copy().cover(-3, -3).root(), undefined);
test.end();
});

tape("quadtree.cover() does not crash on huge values", function(test) {
d3_quadtree.quadtree([[1e23, 0]]);
test.end();
});