diff options
| author | Diederik van Lierop <mail@diedenrezi.nl> | 2008-08-08 22:28:49 +0000 |
|---|---|---|
| committer | dvlierop2 <dvlierop2@users.sourceforge.net> | 2008-08-08 22:28:49 +0000 |
| commit | ef22647ff7f24ab39aac0020f01187587364dae0 (patch) | |
| tree | eac1d153a371f342562f63b8f05ed3329b7a2421 /src/snap.cpp | |
| parent | fix marker behavior for moveto-only paths (diff) | |
| download | inkscape-ef22647ff7f24ab39aac0020f01187587364dae0.tar.gz inkscape-ef22647ff7f24ab39aac0020f01187587364dae0.zip | |
Snap to intersections of any kind of path (were we previously only could snap to intersections of line-segments)
(bzr r6597)
Diffstat (limited to 'src/snap.cpp')
| -rw-r--r-- | src/snap.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/snap.cpp b/src/snap.cpp index 9c9a69a98..778294711 100644 --- a/src/snap.cpp +++ b/src/snap.cpp @@ -23,6 +23,7 @@ #include "sp-namedview.h" #include "snap.h" #include "snapped-line.h" +#include "snapped-curve.h" #include <libnr/nr-point-fns.h> #include <libnr/nr-scale-ops.h> @@ -785,17 +786,17 @@ Inkscape::SnappedPoint SnapManager::findBestSnap(NR::Point const &p, SnappedCons sp_list.push_back(closestPoint); } - // search for the closest snapped line segment - Inkscape::SnappedLineSegment closestLineSegment; - if (getClosestSLS(sc.lines, closestLineSegment)) { - sp_list.push_back(Inkscape::SnappedPoint(closestLineSegment)); + // search for the closest snapped curve + Inkscape::SnappedCurve closestCurve; + if (getClosestCurve(sc.curves, closestCurve)) { + sp_list.push_back(Inkscape::SnappedPoint(closestCurve)); } - if (_intersectionLS) { - // search for the closest snapped intersection of line segments - Inkscape::SnappedPoint closestLineSegmentIntersection; - if (getClosestIntersectionSLS(sc.lines, closestLineSegmentIntersection)) { - sp_list.push_back(closestLineSegmentIntersection); + if (_intersectionCS) { + // search for the closest snapped intersection of curves + Inkscape::SnappedPoint closestCurvesIntersection; + if (getClosestIntersectionCS(sc.curves, p, closestCurvesIntersection)) { + sp_list.push_back(closestCurvesIntersection); } } |
