diff --git a/src/2geom/path.cpp b/src/2geom/path.cpp
index c04d9d08d4c7d3ddf134ffce434f6d0fd61602f5..136e6d4818fee5048c70065a9aeecb9f2a67dd05 100644 (file)
--- a/src/2geom/path.cpp
+++ b/src/2geom/path.cpp
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();
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);
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 )
{