We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2274ead commit f5a24e2Copy full SHA for f5a24e2
1 file changed
js/quadtree.js
@@ -27,7 +27,7 @@ var DIR_OPPOSITES = [
27
[ LL, LR ] // + y
28
];
29
30
-var MAX_LEVELS = 6;
+var MAX_LEVELS = 8;
31
32
33
var Cell = function(bounds) {
@@ -339,10 +339,11 @@ QuadTree.createFromCSGFields = function(fields, maxLevel) {
339
upperLeftMaterial != lowerRightMaterial ||
340
lowerLeftMaterial != upperRightMaterial) {
341
342
- console.log('adding cell at (' + x + ', ' + y + ')');
+ // add cell at max level
343
+ var xx = (cellBounds.left / bounds.width()) * tree.maxVal;
344
+ var yy = (cellBounds.bottom / bounds.height()) * tree.maxVal;
345
- // add cell at max level
- tree.addCellAtDepth(cellBounds.left, cellBounds.bottom, maxLevel);
346
+ tree.addCellAtDepth(xx, yy, maxLevel);
347
}
348
349
0 commit comments