From dae2699cb6569de8755f2376b2bfe166241ed9fb Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sat, 14 Jun 2008 15:16:29 +0000 Subject: update 2geom, fixes includes (bzr r5934) --- src/2geom/pathvector.cpp | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) (limited to 'src/2geom/pathvector.cpp') 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; } -- cgit v1.2.3