diff options
| author | Diederik van Lierop <mailat-signdiedenrezidotnl> | 2009-12-24 20:10:43 +0000 |
|---|---|---|
| committer | Diederik van Lierop <mailat-signdiedenrezidotnl> | 2009-12-24 20:10:43 +0000 |
| commit | bc576428c38521984964e4f9e6289c8da1157173 (patch) | |
| tree | be7c0e78e69461ef617bacce57e39c3698d6f7cb /src/snapper.h | |
| parent | DataMatrix encoder extension by inductiveload (diff) | |
| download | inkscape-bc576428c38521984964e4f9e6289c8da1157173.tar.gz inkscape-bc576428c38521984964e4f9e6289c8da1157173.zip | |
refactoring the snapping code (laying the groundwork for my next commit which reduces snap jitter)
(bzr r8906)
Diffstat (limited to 'src/snapper.h')
| -rw-r--r-- | src/snapper.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/snapper.h b/src/snapper.h index 110b3d36a..93756f7af 100644 --- a/src/snapper.h +++ b/src/snapper.h @@ -39,9 +39,9 @@ namespace Inkscape class Snapper { public: - Snapper() {} - Snapper(SnapManager *sm, ::Geom::Coord const t); - virtual ~Snapper() {} + Snapper() {} + Snapper(SnapManager *sm, ::Geom::Coord const t); + virtual ~Snapper() {} virtual Geom::Coord getSnapperTolerance() const = 0; //returns the tolerance of the snapper in screen pixels (i.e. independent of zoom) virtual bool getSnapperAlwaysSnap() const = 0; //if true, then the snapper will always snap, regardless of its tolerance @@ -53,7 +53,7 @@ public: // These four methods are only used for grids, for which snapping can be enabled individually void setEnabled(bool s); - void setSnapVisibleOnly(bool s); + void setSnapVisibleOnly(bool s); bool getEnabled() const {return _snap_enabled;} bool getSnapVisibleOnly() const {return _snap_visible_only;} @@ -61,7 +61,7 @@ public: 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<SPItem const *> const */*it*/, std::vector<std::pair<Geom::Point, int> > */*unselected_nodes*/) const {}; @@ -90,9 +90,9 @@ public: } Geom::Point projection(Geom::Point const &p) const { // returns the projection of p on this constraintline - Geom::Point const p1_on_cl = _has_point ? _point : p; - Geom::Point const p2_on_cl = p1_on_cl + _direction; - return Geom::projection(p, Geom::Line(p1_on_cl, p2_on_cl)); + Geom::Point const p1_on_cl = _has_point ? _point : p; + Geom::Point const p2_on_cl = p1_on_cl + _direction; + return Geom::projection(p, Geom::Line(p1_on_cl, p2_on_cl)); } private: @@ -103,20 +103,20 @@ public: }; virtual void constrainedSnap(SnappedConstraints &/*sc*/, - SnapPreferences::PointType const &/*t*/, + 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<SPItem const *> const */*it*/) const {}; protected: - SnapManager *_snapmanager; + SnapManager *_snapmanager; - // This is only used for grids, for which snapping can be enabled individually - bool _snap_enabled; ///< true if this snapper is enabled, otherwise false - bool _snap_visible_only; + // This is only used for grids, for which snapping can be enabled individually + bool _snap_enabled; ///< true if this snapper is enabled, otherwise false + bool _snap_visible_only; }; } |
