From fc192305a5194959167fce74e6ff0ff9f11447cf Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Wed, 5 Sep 2007 20:16:30 +0000 Subject: Improving the performance of the object snapper (bzr r3689) --- src/snapper.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/snapper.cpp') diff --git a/src/snapper.cpp b/src/snapper.cpp index 5d39c6b02..17d7b7137 100644 --- a/src/snapper.cpp +++ b/src/snapper.cpp @@ -93,11 +93,13 @@ void Inkscape::Snapper::setEnabled(bool s) Inkscape::SnappedPoint Inkscape::Snapper::freeSnap(PointType const &t, NR::Point const &p, + bool const &first_point, + std::vector &points_to_snap, SPItem const *it) const { std::list lit; lit.push_back(it); - return freeSnap(t, p, lit); + return freeSnap(t, p, first_point, points_to_snap, lit); } @@ -114,13 +116,15 @@ Inkscape::SnappedPoint Inkscape::Snapper::freeSnap(PointType const &t, Inkscape::SnappedPoint Inkscape::Snapper::freeSnap(PointType const &t, NR::Point const &p, + bool const &first_point, + std::vector &points_to_snap, std::list const &it) const { if (_enabled == false || getSnapFrom(t) == false) { return SnappedPoint(p, NR_HUGE); } - return _doFreeSnap(t, p, it); + return _doFreeSnap(t, p, first_point, points_to_snap, it); } @@ -139,12 +143,14 @@ Inkscape::SnappedPoint Inkscape::Snapper::freeSnap(PointType const &t, Inkscape::SnappedPoint Inkscape::Snapper::constrainedSnap(PointType const &t, NR::Point const &p, + bool const &first_point, + std::vector &points_to_snap, ConstraintLine const &c, SPItem const *it) const { std::list lit; lit.push_back(it); - return constrainedSnap(t, p, c, lit); + return constrainedSnap(t, p, first_point, points_to_snap, c, lit); } @@ -161,6 +167,8 @@ Inkscape::SnappedPoint Inkscape::Snapper::constrainedSnap(PointType const &t, Inkscape::SnappedPoint Inkscape::Snapper::constrainedSnap(PointType const &t, NR::Point const &p, + bool const &first_point, + std::vector &points_to_snap, ConstraintLine const &c, std::list const &it) const { @@ -168,7 +176,7 @@ Inkscape::SnappedPoint Inkscape::Snapper::constrainedSnap(PointType const &t, return SnappedPoint(p, NR_HUGE); } - return _doConstrainedSnap(t, p, c, it); + return _doConstrainedSnap(t, p, first_point, points_to_snap, c, it); } /* -- cgit v1.2.3