From 8e980bd257a274f7f32aca2e05f2a694675cf4ef Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Wed, 30 Apr 2008 07:32:12 +0000 Subject: - Major refactoring of snapping related code... - Enabling snap indicator for all remaining tools (bzr r5556) --- src/line-snapper.cpp | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'src/line-snapper.cpp') diff --git a/src/line-snapper.cpp b/src/line-snapper.cpp index b9974c2c0..efa6762b2 100644 --- a/src/line-snapper.cpp +++ b/src/line-snapper.cpp @@ -23,14 +23,18 @@ Inkscape::LineSnapper::LineSnapper(SPNamedView const *nv, NR::Coord const d) : S } -void Inkscape::LineSnapper::_doFreeSnap(SnappedConstraints &sc, +void Inkscape::LineSnapper::freeSnap(SnappedConstraints &sc, Inkscape::Snapper::PointType const &t, NR::Point const &p, - bool const &f, - std::vector &points_to_snap, - std::vector const &it, - std::vector *unselected_nodes) const + bool const &/*f*/, + NR::Maybe const &/*bbox_to_snap*/, + std::vector const */*it*/, + std::vector */*unselected_nodes*/) const { + if (_snap_enabled == false || getSnapFrom(t) == false) { + return; + } + /* Get the lines that we will try to snap to */ const LineList lines = _getSnapLines(p); @@ -53,15 +57,19 @@ void Inkscape::LineSnapper::_doFreeSnap(SnappedConstraints &sc, } } -void Inkscape::LineSnapper::_doConstrainedSnap(SnappedConstraints &sc, - Inkscape::Snapper::PointType const &/*t*/, +void Inkscape::LineSnapper::constrainedSnap(SnappedConstraints &sc, + Inkscape::Snapper::PointType const &t, NR::Point const &p, bool const &/*f*/, - std::vector &/*points_to_snap*/, + NR::Maybe const &/*bbox_to_snap*/, ConstraintLine const &c, - std::vector const &/*it*/) const + std::vector const */*it*/) const { + if (_snap_enabled == false || getSnapFrom(t) == false) { + return; + } + /* Get the lines that we will try to snap to */ const LineList lines = _getSnapLines(p); -- cgit v1.2.3