From bc576428c38521984964e4f9e6289c8da1157173 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Thu, 24 Dec 2009 21:10:43 +0100 Subject: refactoring the snapping code (laying the groundwork for my next commit which reduces snap jitter) (bzr r8906) --- src/line-snapper.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/line-snapper.h') diff --git a/src/line-snapper.h b/src/line-snapper.h index 4ad08a99f..af36b8330 100644 --- a/src/line-snapper.h +++ b/src/line-snapper.h @@ -28,7 +28,7 @@ public: Inkscape::SnapPreferences::PointType const &t, Geom::Point const &p, SnapSourceType const &source_type, - bool const &first_point, + long source_num, Geom::OptRect const &bbox_to_snap, std::vector const *it, std::vector > *unselected_nodes) const; @@ -37,7 +37,7 @@ public: Inkscape::SnapPreferences::PointType const &t, Geom::Point const &p, SnapSourceType const &source_type, - bool const &first_point, + long source_num, Geom::OptRect const &bbox_to_snap, ConstraintLine const &c, std::vector const *it) const; @@ -54,12 +54,12 @@ private: */ virtual LineList _getSnapLines(Geom::Point const &p) const = 0; - virtual void _addSnappedLine(SnappedConstraints &sc, Geom::Point const snapped_point, Geom::Coord const snapped_distance, SnapSourceType const &source, Geom::Point const normal_to_line, Geom::Point const point_on_line) const = 0; + virtual void _addSnappedLine(SnappedConstraints &sc, Geom::Point const snapped_point, Geom::Coord const snapped_distance, SnapSourceType const &source, long source_num, Geom::Point const normal_to_line, Geom::Point const point_on_line) const = 0; // Will only be implemented for guide lines, because grid lines don't have an origin - virtual void _addSnappedLinesOrigin(SnappedConstraints &sc, Geom::Point const origin, Geom::Coord const snapped_distance, SnapSourceType const &source) const; + virtual void _addSnappedLinesOrigin(SnappedConstraints &sc, Geom::Point const origin, Geom::Coord const snapped_distance, SnapSourceType const &source, long source_num) const; - virtual void _addSnappedPoint(SnappedConstraints &sc, Geom::Point const snapped_point, Geom::Coord const snapped_distance, SnapSourceType const &source) const = 0; + virtual void _addSnappedPoint(SnappedConstraints &sc, Geom::Point const snapped_point, Geom::Coord const snapped_distance, SnapSourceType const &source, long source_num) const = 0; }; } -- cgit v1.2.3 From e8f4c644181a8a68e2c33e1783f77a400dc1a29f Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Sat, 9 Jan 2010 22:14:38 +0100 Subject: Refactoring the snapping API (making it easier to maintain and understand for the devs) (bzr r8960) --- src/line-snapper.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/line-snapper.h') diff --git a/src/line-snapper.h b/src/line-snapper.h index af36b8330..5845e081e 100644 --- a/src/line-snapper.h +++ b/src/line-snapper.h @@ -18,6 +18,7 @@ namespace Inkscape { +class SnapCandidatePoint; class LineSnapper : public Snapper { @@ -26,18 +27,14 @@ public: void freeSnap(SnappedConstraints &sc, Inkscape::SnapPreferences::PointType const &t, - Geom::Point const &p, - SnapSourceType const &source_type, - long source_num, + Inkscape::SnapCandidatePoint const &p, Geom::OptRect const &bbox_to_snap, std::vector const *it, - std::vector > *unselected_nodes) const; + std::vector *unselected_nodes) const; void constrainedSnap(SnappedConstraints &sc, Inkscape::SnapPreferences::PointType const &t, - Geom::Point const &p, - SnapSourceType const &source_type, - long source_num, + Inkscape::SnapCandidatePoint const &p, Geom::OptRect const &bbox_to_snap, ConstraintLine const &c, std::vector const *it) const; -- cgit v1.2.3