Skip to content

Commit 5f9ca5b

Browse files
authored
Merge pull request #349 from wdr-data/fix/infinite-bounds-loop
Fix bug when bounds would be infinite and cause never ending loop
2 parents 834c5eb + fdea47d commit 5f9ca5b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/RenderWebGL.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,12 @@ class RenderWebGL extends EventEmitter {
968968
if (candidateIDs.length === 0) {
969969
return false;
970970
}
971+
971972
const bounds = this.clientSpaceToScratchBounds(centerX, centerY, touchWidth, touchHeight);
973+
if (bounds.left === -Infinity || bounds.bottom === -Infinity) {
974+
return false;
975+
}
976+
972977
const hits = [];
973978
const worldPos = twgl.v3.create(0, 0, 0);
974979
// Iterate over the scratch pixels and check if any candidate can be

0 commit comments

Comments
 (0)