diff options
| author | Diederik van Lierop <mail@diedenrezi.nl> | 2007-07-28 15:47:49 +0000 |
|---|---|---|
| committer | dvlierop2 <dvlierop2@users.sourceforge.net> | 2007-07-28 15:47:49 +0000 |
| commit | b79f13c5491131606a50a112a296e1011ddc91ee (patch) | |
| tree | 5959773e1d0206a0d6a4b240dd3f137507232861 /src/snapper.h | |
| parent | Set top-level groups as layers with the name of the PDF document (diff) | |
| download | inkscape-b79f13c5491131606a50a112a296e1011ddc91ee.tar.gz inkscape-b79f13c5491131606a50a112a296e1011ddc91ee.zip | |
1) Changes to snapping preferences dialog
2) Strict snapping implemented, i.e. bbox only to bbox and nodes only to paths/nodes
3) Renaming of some constants to improve readability
(bzr r3331)
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 25e345305..1440f64c7 100644 --- a/src/snapper.h +++ b/src/snapper.h @@ -33,30 +33,28 @@ public: /// Point types to snap. typedef int PointType; - static const PointType SNAP_POINT; - static const PointType BBOX_POINT; + static const PointType SNAPPOINT_NODE; + static const PointType SNAPPOINT_BBOX; - typedef std::pair<PointType, NR::Point> PointWithType; - - void setSnapTo(PointType t, bool s); + void setSnapFrom(PointType t, bool s); void setDistance(::NR::Coord d); - bool getSnapTo(PointType t) const; + bool getSnapFrom(PointType t) const; ::NR::Coord getDistance() const; /** * \return true if this Snapper will snap at least one kind of point. */ - virtual bool ThisSnapperMightSnap() const {return (_enabled && _snap_to != 0);} // will likely be overridden by derived classes + virtual bool ThisSnapperMightSnap() const {return (_enabled && _snap_from != 0);} // will likely be overridden by derived classes void setEnabled(bool s); - SnappedPoint freeSnap(PointType t, + SnappedPoint freeSnap(PointType const &t, NR::Point const &p, SPItem const *it) const; - SnappedPoint freeSnap(PointType t, + SnappedPoint freeSnap(PointType const &t, NR::Point const &p, std::list<SPItem const *> const &it) const; @@ -85,18 +83,18 @@ public: NR::Point _direction; }; - SnappedPoint constrainedSnap(PointType t, + SnappedPoint constrainedSnap(PointType const &t, NR::Point const &p, ConstraintLine const &c, SPItem const *it) const; - SnappedPoint constrainedSnap(PointType t, + SnappedPoint constrainedSnap(PointType const &t, NR::Point const &p, ConstraintLine const &c, std::list<SPItem const *> const &it) const; protected: SPNamedView const *_named_view; - int _snap_to; ///< bitmap of point types that we will snap to + int _snap_from; ///< bitmap of point types that we will snap from bool _enabled; ///< true if this snapper is enabled, otherwise false private: @@ -110,7 +108,8 @@ private: * \param it Items that should not be snapped to. * \return Snapped point. */ - virtual SnappedPoint _doFreeSnap(NR::Point const &p, + virtual SnappedPoint _doFreeSnap(PointType const &t, + NR::Point const &p, std::list<SPItem const *> const &it) const = 0; /** @@ -123,7 +122,8 @@ private: * \param it Items that should not be snapped to. * \return Snapped point. */ - virtual SnappedPoint _doConstrainedSnap(NR::Point const &p, + virtual SnappedPoint _doConstrainedSnap(PointType const &t, + NR::Point const &p, ConstraintLine const &c, std::list<SPItem const *> const &it) const = 0; |
