From ef22647ff7f24ab39aac0020f01187587364dae0 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Fri, 8 Aug 2008 22:28:49 +0000 Subject: Snap to intersections of any kind of path (were we previously only could snap to intersections of line-segments) (bzr r6597) --- src/snap.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/snap.cpp') 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 #include @@ -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); } } -- cgit v1.2.3