summaryrefslogtreecommitdiffstats
path: root/src/2geom/path.cpp
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2008-11-21 05:24:08 +0000
committerTed Gould <ted@canonical.com>2008-11-21 05:24:08 +0000
commit44a3a78fb6a3863c0c7f3c1193837337e68a67e4 (patch)
tree1722ee5ec6f88c881cd4124923354b3c1311501b /src/2geom/path.cpp
parentMerge from trunk (diff)
downloadinkscape-44a3a78fb6a3863c0c7f3c1193837337e68a67e4.tar.gz
inkscape-44a3a78fb6a3863c0c7f3c1193837337e68a67e4.zip
Merge from fe-moved
(bzr r6891)
Diffstat (limited to 'src/2geom/path.cpp')
-rw-r--r--src/2geom/path.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/2geom/path.cpp b/src/2geom/path.cpp
index c04d9d08d..136e6d481 100644
--- a/src/2geom/path.cpp
+++ b/src/2geom/path.cpp
@@ -43,21 +43,21 @@ using namespace Geom::PathInternal;
namespace Geom
{
-Rect Path::boundsFast() const {
- Rect bounds;
+OptRect Path::boundsFast() const {
+ OptRect bounds;
if (empty()) return bounds;
bounds=front().boundsFast();
const_iterator iter = begin();
if ( iter != end() ) {
- for ( ++iter; iter != end() ; ++iter ) {
- bounds.unionWith(iter->boundsFast());
- }
+ for ( ++iter; iter != end() ; ++iter ) {
+ bounds.unionWith(iter->boundsFast());
+ }
}
return bounds;
}
-Rect Path::boundsExact() const {
- Rect bounds;
+OptRect Path::boundsExact() const {
+ OptRect bounds;
if (empty()) return bounds;
bounds=front().boundsExact();
const_iterator iter = begin();
@@ -143,10 +143,10 @@ Path::allNearestPoints(Point const& _point, double from, double to) const
double dsq;
double mindistsq
= distanceSq( _point, _path[si].pointAt( all_np.front().front() ) );
- Rect bb;
+ Rect bb(Geom::Point(0,0),Geom::Point(0,0));
for ( unsigned int i = si + 1; i < ei; ++i )
{
- bb = _path[i].boundsFast();
+ bb = *(_path[i].boundsFast());
dsq = distanceSq(_point, bb);
if ( mindistsq < dsq ) continue;
all_t = _path[i].allNearestPoints(_point);
@@ -165,7 +165,7 @@ Path::allNearestPoints(Point const& _point, double from, double to) const
ni.push_back(i);
}
}
- bb = _path[ei].boundsFast();
+ bb = *(_path[ei].boundsFast());
dsq = distanceSq(_point, bb);
if ( mindistsq >= dsq )
{
@@ -254,10 +254,10 @@ double Path::nearestPoint(Point const &_point, double from, double to, double *d
unsigned int ni = si;
double dsq;
double mindistsq = distanceSq(_point, _path[si].pointAt(nearest));
- Rect bb;
+ Rect bb(Geom::Point(0,0),Geom::Point(0,0));
for ( unsigned int i = si + 1; i < ei; ++i )
{
- bb = _path[i].boundsFast();
+ bb = *(_path[i].boundsFast());
dsq = distanceSq(_point, bb);
if ( mindistsq <= dsq ) continue;
t = _path[i].nearestPoint(_point);
@@ -269,7 +269,7 @@ double Path::nearestPoint(Point const &_point, double from, double to, double *d
mindistsq = dsq;
}
}
- bb = _path[ei].boundsFast();
+ bb = *(_path[ei].boundsFast());
dsq = distanceSq(_point, bb);
if ( mindistsq > dsq )
{