From 6b8572be4bdae9ee79fc42c9d18fd9882dec21aa Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Sun, 23 Nov 2008 13:55:26 +0000 Subject: 1) Improve the way the distance to the pointer is taken into account when finding the best snap 2) Use this distance also when snapping nodes in the path editor 3) Add a slider in the preferences dialog to control the weighing of this distance (bzr r6895) --- src/object-snapper.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/object-snapper.cpp') diff --git a/src/object-snapper.cpp b/src/object-snapper.cpp index 1fd566c82..06f24c47f 100644 --- a/src/object-snapper.cpp +++ b/src/object-snapper.cpp @@ -247,7 +247,7 @@ void Inkscape::ObjectSnapper::_snapNodes(SnappedConstraints &sc, for (std::vector::const_iterator k = _points_to_snap_to->begin(); k != _points_to_snap_to->end(); k++) { Geom::Coord dist = Geom::L2(*k - p); - if (dist < getSnapperTolerance() && dist < s.getDistance()) { + if (dist < getSnapperTolerance() && dist < s.getSnapDistance()) { s = SnappedPoint(*k, SNAPTARGET_NODE, dist, getSnapperTolerance(), getSnapperAlwaysSnap(), true); success = true; } @@ -276,7 +276,7 @@ void Inkscape::ObjectSnapper::_snapTranslatingGuideToNodes(SnappedConstraints &s Geom::Point p_proj = project_on_linesegment(*k, p, p + Geom::rot90(guide_normal)); Geom::Coord dist = Geom::L2(*k - 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.getDistance())) { + if ((dist < tol && dist2 < tol) || (getSnapperAlwaysSnap() && dist < s.getSnapDistance())) { s = SnappedPoint(*k, SNAPTARGET_NODE, dist, tol, getSnapperAlwaysSnap(), true); success = true; } -- cgit v1.2.3