diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2012-01-04 18:17:44 +0000 |
|---|---|---|
| committer | Johan Engelen <goejendaagh@zonnet.nl> | 2012-01-04 18:17:44 +0000 |
| commit | 71fb33927ed70360073e7063c447b5ac46ee7c60 (patch) | |
| tree | 828bcdcddf9a1a3030fc758ef5d0a1193959ce3b /src/2geom/quadtree.cpp | |
| parent | More GSEAL issues (diff) | |
| download | inkscape-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.cpp | 8 |
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) { |
