summaryrefslogtreecommitdiffstats
path: root/src/object-snapper.cpp
diff options
context:
space:
mode:
authorDiederik van Lierop <mail@diedenrezi.nl>2008-11-23 13:55:26 +0000
committerdvlierop2 <dvlierop2@users.sourceforge.net>2008-11-23 13:55:26 +0000
commit6b8572be4bdae9ee79fc42c9d18fd9882dec21aa (patch)
treeccfc4f2203495ee82127b0cb596f23a9d9f48803 /src/object-snapper.cpp
parentUpdating the includes on these files because they need to include simple-node... (diff)
downloadinkscape-6b8572be4bdae9ee79fc42c9d18fd9882dec21aa.tar.gz
inkscape-6b8572be4bdae9ee79fc42c9d18fd9882dec21aa.zip
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)
Diffstat (limited to 'src/object-snapper.cpp')
-rw-r--r--src/object-snapper.cpp4
1 files changed, 2 insertions, 2 deletions
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<Geom::Point>::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;
}