fix: QuadTree nodes can be a list

This commit is contained in:
cha0s 2019-04-20 01:02:47 -05:00
parent 97c3bb8c5a
commit 0fdff9b33c

View File

@ -27,10 +27,11 @@ export class QuadTree {
if (4 === node.length) {
return;
}
if (!Rectangle.intersects(queryRectangle, node.data)) {
return;
}
nodes.push(node);
do {
if (Rectangle.intersects(queryRectangle, node.data)) {
nodes.push(node);
}
} while (node = node.next);
});
return nodes;
}