Skip to content

Commit

Permalink
Fix bad merge for PointQuadTree
Browse files Browse the repository at this point in the history
  • Loading branch information
broady committed Feb 12, 2014
1 parent 7af9e8c commit 584a5a7
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions library/src/com/google/maps/android/quadtree/PointQuadTree.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ private void insert(double x, double y, T item) {
if (this.mChildren != null) {
if (y < mBounds.midY) {
if (x < mBounds.midX) { // top left
mChildren[0].insert(x, y, item);
mChildren.get(0).insert(x, y, item);
} else { // top right
mChildren[1].insert(x, y, item);
mChildren.get(1).insert(x, y, item);
}
} else {
if (x < mBounds.midX) { // bottom left
mChildren[2].insert(x, y, item);
mChildren.get(2).insert(x, y, item);
} else {
mChildren[3].insert(x, y, item);
mChildren.get(3).insert(x, y, item);
}
}
return;
Expand Down Expand Up @@ -160,15 +160,15 @@ private boolean remove(double x, double y, T item) {
if (this.mChildren != null) {
if (y < mBounds.midY) {
if (x < mBounds.midX) { // top left
return mChildren[0].remove(x, y, item);
return mChildren.get(0).remove(x, y, item);
} else { // top right
return mChildren[1].remove(x, y, item);
return mChildren.get(1).remove(x, y, item);
}
} else {
if (x < mBounds.midX) { // bottom left
return mChildren[2].remove(x, y, item);
return mChildren.get(2).remove(x, y, item);
} else {
return mChildren[3].remove(x, y, item);
return mChildren.get(3).remove(x, y, item);
}
}
}
Expand Down

0 comments on commit 584a5a7

Please sign in to comment.