From a3c3cc9739e96c6e36bfcbcf2cf41429cae48791 Mon Sep 17 00:00:00 2001 From: dvlierop2 Date: Tue, 31 Mar 2009 20:41:19 +0000 Subject: [PATCH] More sensitive selection of snap target when snapping guides to objects with multiple snap candidates (fixes bug 352247) --- src/object-snapper.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/object-snapper.cpp b/src/object-snapper.cpp index e0506c8e2..0ec1a7ba5 100644 --- a/src/object-snapper.cpp +++ b/src/object-snapper.cpp @@ -297,7 +297,6 @@ void Inkscape::ObjectSnapper::_snapTranslatingGuideToNodes(SnappedConstraints &s _collectNodes(t, true); SnappedPoint s; - bool success = false; Geom::Coord tol = getSnapperTolerance(); @@ -306,15 +305,12 @@ void Inkscape::ObjectSnapper::_snapTranslatingGuideToNodes(SnappedConstraints &s Geom::Point p_proj = Geom::projection((*k).first, Geom::Line(p, p + Geom::rot90(guide_normal))); Geom::Coord dist = Geom::L2((*k).first - p_proj); // distance from node to the guide Geom::Coord dist2 = Geom::L2(p - p_proj); // distance from projection of node on the guide, to the mouse location - if ((dist < tol && dist2 < tol) || (getSnapperAlwaysSnap() && dist < s.getSnapDistance())) { + std::cout << "d1 = " << dist << " | d2 = " << dist2 << " | tol = " << tol << std::endl; + if ((dist < tol && dist2 < tol) || getSnapperAlwaysSnap()) { s = SnappedPoint((*k).first, SNAPSOURCE_GUIDE, static_cast((*k).second), dist, tol, getSnapperAlwaysSnap(), true); - success = true; + sc.points.push_back(s); } } - - if (success) { - sc.points.push_back(s); - } } -- 2.30.2