diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2008-06-14 15:16:29 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2008-06-14 15:16:29 +0000 |
| commit | dae2699cb6569de8755f2376b2bfe166241ed9fb (patch) | |
| tree | 2ba8946b09cc6f87b7cc5c9abadd6bc23ee76fdd /src | |
| parent | Win32 fix: set stdout to binary mode before writing a file to it (diff) | |
| download | inkscape-dae2699cb6569de8755f2376b2bfe166241ed9fb.tar.gz inkscape-dae2699cb6569de8755f2376b2bfe166241ed9fb.zip | |
update 2geom, fixes includes
(bzr r5934)
Diffstat (limited to 'src')
| -rw-r--r-- | src/2geom/path.cpp | 28 | ||||
| -rw-r--r-- | src/2geom/pathvector.cpp | 28 | ||||
| -rw-r--r-- | src/2geom/pathvector.h | 2 |
3 files changed, 6 insertions, 52 deletions
diff --git a/src/2geom/path.cpp b/src/2geom/path.cpp index 0ff1f3b0c..8bfccf87a 100644 --- a/src/2geom/path.cpp +++ b/src/2geom/path.cpp @@ -245,22 +245,10 @@ Rect Path::boundsFast() if (empty()) return bound; bound = begin()->boundsFast(); - double top = bound.top(); - double bottom = bound.bottom(); - double left = bound.left(); - double right = bound.right(); for (iterator it = ++begin(); it != end(); ++it) { - bound = it->boundsFast(); - if ( top > bound.top() ) top = bound.top(); - if ( bottom < bound.bottom() ) bottom = bound.bottom(); - if ( left > bound.left() ) left = bound.left(); - if ( right < bound.right() ) right = bound.right(); + bound.unionWith(it->boundsFast()); } - bound[0][0] = left; - bound[0][1] = right; - bound[1][0] = top; - bound[1][1] = bottom; return bound; } @@ -270,22 +258,10 @@ Rect Path::boundsExact() if (empty()) return bound; bound = begin()->boundsExact(); - double top = bound.top(); - double bottom = bound.bottom(); - double left = bound.left(); - double right = bound.right(); for (iterator it = ++begin(); it != end(); ++it) { - bound = it->boundsExact(); - if ( top > bound.top() ) top = bound.top(); - if ( bottom < bound.bottom() ) bottom = bound.bottom(); - if ( left > bound.left() ) left = bound.left(); - if ( right < bound.right() ) right = bound.right(); + bound.unionWith(it->boundsExact()); } - bound[0][0] = left; - bound[0][1] = right; - bound[1][0] = top; - bound[1][1] = bottom; return bound; } diff --git a/src/2geom/pathvector.cpp b/src/2geom/pathvector.cpp index 9c8111767..fe2f1976c 100644 --- a/src/2geom/pathvector.cpp +++ b/src/2geom/pathvector.cpp @@ -73,22 +73,10 @@ Rect bounds_fast( PathVector const& pv ) if (pv.empty()) return bound; bound = (pv.begin())->boundsFast(); - double top = bound.top(); - double bottom = bound.bottom(); - double left = bound.left(); - double right = bound.right(); for (const_iterator it = ++(pv.begin()); it != pv.end(); ++it) { - bound = it->boundsFast(); - if ( top > bound.top() ) top = bound.top(); - if ( bottom < bound.bottom() ) bottom = bound.bottom(); - if ( left > bound.left() ) left = bound.left(); - if ( right < bound.right() ) right = bound.right(); + bound.unionWith(it->boundsFast()); } - bound[0][0] = left; - bound[0][1] = right; - bound[1][0] = top; - bound[1][1] = bottom; return bound; } @@ -100,22 +88,10 @@ Rect bounds_exact( PathVector const& pv ) if (pv.empty()) return bound; bound = (pv.begin())->boundsExact(); - double top = bound.top(); - double bottom = bound.bottom(); - double left = bound.left(); - double right = bound.right(); for (const_iterator it = ++(pv.begin()); it != pv.end(); ++it) { - bound = it->boundsExact(); - if ( top > bound.top() ) top = bound.top(); - if ( bottom < bound.bottom() ) bottom = bound.bottom(); - if ( left > bound.left() ) left = bound.left(); - if ( right < bound.right() ) right = bound.right(); + bound.unionWith(it->boundsExact()); } - bound[0][0] = left; - bound[0][1] = right; - bound[1][0] = top; - bound[1][1] = bottom; return bound; } diff --git a/src/2geom/pathvector.h b/src/2geom/pathvector.h index a9f4d88ed..6a759e406 100644 --- a/src/2geom/pathvector.h +++ b/src/2geom/pathvector.h @@ -36,6 +36,8 @@ #define SEEN_GEOM_PATHVECTOR_H #include "forward.h" +#include "path.h" +#include "rect.h" namespace Geom { |
