summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a34e754)
raw | patch | inline | side by side (parent: a34e754)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Sat, 14 Jun 2008 15:16:29 +0000 (15:16 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Sat, 14 Jun 2008 15:16:29 +0000 (15:16 +0000) |
src/2geom/path.cpp | patch | blob | history | |
src/2geom/pathvector.cpp | patch | blob | history | |
src/2geom/pathvector.h | patch | blob | history |
diff --git a/src/2geom/path.cpp b/src/2geom/path.cpp
index 0ff1f3b0c65a624fec53fc4f644096be5b245aff..8bfccf87a33dd2a82c428ff3b74e01925bbbc926 100644 (file)
--- a/src/2geom/path.cpp
+++ b/src/2geom/path.cpp
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;
}
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;
}
index 9c8111767df1c37d6c000b34b6ecad183cdee583..fe2f1976cdf73d755e7d9ff5b4339317c6b888e2 100644 (file)
--- a/src/2geom/pathvector.cpp
+++ b/src/2geom/pathvector.cpp
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;
}
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 a9f4d88ed328b86bea3043e57829768182032498..6a759e40638d9957b297e5f7b2240c3f38b7e757 100644 (file)
--- a/src/2geom/pathvector.h
+++ b/src/2geom/pathvector.h
#define SEEN_GEOM_PATHVECTOR_H
#include "forward.h"
+#include "path.h"
+#include "rect.h"
namespace Geom {