Skip to content

Commit c629277

Browse files
committed
Fix a bug in QuadTree.clear()
- According to this comment, only the root bounds should be resized: https://github.com/melonjs/melonJS/blob/61ed171238cbe75c842963e1fed7b66e7ab7f862/src/physics/quadtree.js#L281 - QuadTree nodes have a fake me.Rect for their bounds: https://github.com/melonjs/melonJS/blob/61ed171238cbe75c842963e1fed7b66e7ab7f862/src/physics/quadtree.js#L83-L88 - Together, these cause an exception when `bounds` is passed to the clear() method: "this.bounds.setShape is not a function"
1 parent 941fed4 commit c629277

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/physics/quadtree.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@
271271
this.objects = [];
272272

273273
for (var i = 0; i < this.nodes.length; i = i + 1) {
274-
this.nodes[i].clear(bounds);
274+
this.nodes[i].clear();
275275
// recycle the quadTree object
276276
QT_ARRAY_PUSH(this.nodes[i]);
277277
}

0 commit comments

Comments
 (0)