summaryrefslogtreecommitdiffstats
path: root/src/2geom/quadtree.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2012-01-04 18:17:44 +0000
committerJohan Engelen <goejendaagh@zonnet.nl>2012-01-04 18:17:44 +0000
commit71fb33927ed70360073e7063c447b5ac46ee7c60 (patch)
tree828bcdcddf9a1a3030fc758ef5d0a1193959ce3b /src/2geom/quadtree.cpp
parentMore GSEAL issues (diff)
downloadinkscape-71fb33927ed70360073e7063c447b5ac46ee7c60.tar.gz
inkscape-71fb33927ed70360073e7063c447b5ac46ee7c60.zip
update 2geom to r2049. fixes bugs!
(bzr r10837)
Diffstat (limited to 'src/2geom/quadtree.cpp')
-rw-r--r--src/2geom/quadtree.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/2geom/quadtree.cpp b/src/2geom/quadtree.cpp
index 08e6dd7e2..f30475415 100644
--- a/src/2geom/quadtree.cpp
+++ b/src/2geom/quadtree.cpp
@@ -131,7 +131,7 @@ void QuadTree::insert(double x0, double y0, double x1, double y1, int shape) {
// loop until a quad would break the box.
// empty root => empty QuadTree. Create initial bounding box (0,0), (1,1)
- if(root == 0) {
+ if(root == NULL) {
root = new Quad;
bx0 = 0;
@@ -179,7 +179,7 @@ void QuadTree::insert(double x0, double y0, double x1, double y1, int shape) {
by1 = byy1;
}
- while(q) {
+ while(true) {
// Find the center of the temp bounding box
double cx = (bxx0 + bxx1)/2;
double cy = (byy0 + byy1)/2;
@@ -225,7 +225,7 @@ void QuadTree::insert(double x0, double y0, double x1, double y1, int shape) {
*/
assert(i < 4);
Quad *qq = q->children[i];
- if(qq == 0) {
+ if(qq == NULL) {
qq = new Quad;
q->children[i] = qq;
}
@@ -233,6 +233,8 @@ void QuadTree::insert(double x0, double y0, double x1, double y1, int shape) {
}
q->data.push_back(shape);
}
+
+
void QuadTree::erase(Quad *q, int shape) {
for(Quad::iterator i = q->data.begin(); i != q->data.end(); i++) {
if(*i == shape) {