Merge pull request #349 from wdr-data/fix/infinite-bounds-loop

Fix bug when bounds would be infinite and cause never ending loop
This commit is contained in:
Chris Willis-Ford 2018-10-02 12:18:21 -07:00 committed by GitHub
commit 5f9ca5b4fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -968,7 +968,12 @@ class RenderWebGL extends EventEmitter {
if (candidateIDs.length === 0) {
return false;
}
const bounds = this.clientSpaceToScratchBounds(centerX, centerY, touchWidth, touchHeight);
if (bounds.left === -Infinity || bounds.bottom === -Infinity) {
return false;
}
const hits = [];
const worldPos = twgl.v3.create(0, 0, 0);
// Iterate over the scratch pixels and check if any candidate can be