summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDiederik van Lierop <mail@diedenrezi.nl>2009-03-31 20:41:19 +0000
committerdvlierop2 <dvlierop2@users.sourceforge.net>2009-03-31 20:41:19 +0000
commit3ec760520ccb8f17875c944adddcd30aeb152cb8 (patch)
treee38e6193e7d11ee42c85393f0a52ea9de0ebd570 /src
parentSome minor snap-delay modifications (diff)
downloadinkscape-3ec760520ccb8f17875c944adddcd30aeb152cb8.tar.gz
inkscape-3ec760520ccb8f17875c944adddcd30aeb152cb8.zip
More sensitive selection of snap target when snapping guides to objects with multiple snap candidates (fixes bug 352247)
(bzr r7598)
Diffstat (limited to 'src')
-rw-r--r--src/object-snapper.cpp10
1 files 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<Inkscape::SnapTargetType>((*k).second), dist, tol, getSnapperAlwaysSnap(), true);
- success = true;
+ sc.points.push_back(s);
}
}
-
- if (success) {
- sc.points.push_back(s);
- }
}