Skip to content

Commit

Permalink
avoid division by zero, close #34
Browse files Browse the repository at this point in the history
  • Loading branch information
mourner committed Feb 17, 2021
1 parent 6903d4b commit 306fecf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ export default class Flatbush {
return;
}

const width = this.maxX - this.minX;
const height = this.maxY - this.minY;
const width = (this.maxX - this.minX) || 1;
const height = (this.maxY - this.minY) || 1;
const hilbertValues = new Uint32Array(this.numItems);
const hilbertMax = (1 << 16) - 1;

Expand Down

0 comments on commit 306fecf

Please sign in to comment.