Skip to content

Commit

Permalink
fix querying symbols with -allow-overlap: true
Browse files Browse the repository at this point in the history
  • Loading branch information
ansis committed Mar 16, 2016
1 parent e04f28d commit 43493ca
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions js/symbol/collision_tile.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,21 +119,21 @@ CollisionTile.prototype.placeCollisionFeature = function(collisionFeature, allow

box._setIndex(b);

if (!allowOverlap) {
var anchorPoint = box.anchorPoint._matMult(rotationMatrix);
var x = anchorPoint.x;
var y = anchorPoint.y;
var anchorPoint = box.anchorPoint._matMult(rotationMatrix);
var x = anchorPoint.x;
var y = anchorPoint.y;

var x1 = x + box.x1;
var y1 = y + box.y1 * yStretch;
var x2 = x + box.x2;
var y2 = y + box.y2 * yStretch;
var x1 = x + box.x1;
var y1 = y + box.y1 * yStretch;
var x2 = x + box.x2;
var y2 = y + box.y2 * yStretch;

box.bbox0 = x1;
box.bbox1 = y1;
box.bbox2 = x2;
box.bbox3 = y2;
box.bbox0 = x1;
box.bbox1 = y1;
box.bbox2 = x2;
box.bbox3 = y2;

if (!allowOverlap) {
var blockingBoxes = this.grid.query(x1, y1, x2, y2);

for (var i = 0; i < blockingBoxes.length; i++) {
Expand Down

0 comments on commit 43493ca

Please sign in to comment.