From 0a78ad638f3bbcd46631cb2c741fca031356b725 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Sat, 8 Mar 2008 11:32:18 +0000 Subject: Node tool: snap to paths and their nodes, incl. to the path currently being edited (bzr r4989) --- src/snapper.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'src/snapper.cpp') diff --git a/src/snapper.cpp b/src/snapper.cpp index 5f5261885..f8f7705f2 100644 --- a/src/snapper.cpp +++ b/src/snapper.cpp @@ -97,20 +97,21 @@ void Inkscape::Snapper::setEnabled(bool s) * \return Snapped point. */ -void Inkscape::Snapper::freeSnap(SnappedConstraints &sc, - +void Inkscape::Snapper::freeSnap(SnappedConstraints &sc, PointType const &t, NR::Point const &p, bool const &first_point, - std::vector &points_to_snap, + std::vector &points_to_snap, SPItem const *it) const { std::list lit; - lit.push_back(it); - freeSnap(sc, t, p, first_point, points_to_snap, lit); + if (it) { + lit.push_back(it); + } + + freeSnap(sc, t, p, first_point, points_to_snap, lit, NULL); } - /** * Try to snap a point to whatever this snapper is interested in. Any * snap that occurs will be to the nearest "interesting" thing (e.g. a @@ -127,14 +128,15 @@ void Inkscape::Snapper::freeSnap(SnappedConstraints &sc, PointType const &t, NR::Point const &p, bool const &first_point, - std::vector &points_to_snap, - std::list const &it) const + std::vector &points_to_snap, + std::list const &it, + std::vector *unselected_nodes) const { if (_snap_enabled == false || getSnapFrom(t) == false) { return; } - _doFreeSnap(sc, t, p, first_point, points_to_snap, it); + _doFreeSnap(sc, t, p, first_point, points_to_snap, it, unselected_nodes); } -- cgit v1.2.3