summaryrefslogtreecommitdiffstats
path: root/src/2geom/path.cpp
diff options
context:
space:
mode:
authorDiederik van Lierop <mail@diedenrezi.nl>2008-08-15 20:23:54 +0000
committerdvlierop2 <dvlierop2@users.sourceforge.net>2008-08-15 20:23:54 +0000
commit303f67444b402faaf8ebf9645de4b4362b31d35c (patch)
treed9e8550b6e4021a05d966690d4e02ec239b8784b /src/2geom/path.cpp
parentEliminate more of SP_ACTIVE_DESKTOP (diff)
downloadinkscape-303f67444b402faaf8ebf9645de4b4362b31d35c.tar.gz
inkscape-303f67444b402faaf8ebf9645de4b4362b31d35c.zip
Update to 2geom rev. 1538
(bzr r6634)
Diffstat (limited to 'src/2geom/path.cpp')
-rw-r--r--src/2geom/path.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/2geom/path.cpp b/src/2geom/path.cpp
index 2943d6a92..ac45459bd 100644
--- a/src/2geom/path.cpp
+++ b/src/2geom/path.cpp
@@ -198,6 +198,20 @@ Path::allNearestPoints(Point const& _point, double from, double to) const
return all_nearest;
}
+std::vector<double>
+Path::nearestPointPerCurve(Point const& _point) const
+{
+ //return a single nearest point for each curve in this path
+ std::vector<double> np;
+ const Path& _path = *this;
+ for (Sequence::const_iterator it = _path.get_curves().begin() ; it != _path.get_curves().end()-1 ; ++it)
+ //for (std::vector<Path>::const_iterator it = _path.begin(); it != _path.end(), ++it){
+ {
+ np.push_back((*it)->nearestPoint(_point));
+ }
+ return np;
+}
+
double Path::nearestPoint(Point const &_point, double from, double to, double *distance_squared) const
{
if ( from > to ) std::swap(from, to);