diff options
| author | Diederik van Lierop <mail@diedenrezi.nl> | 2007-04-17 21:26:43 +0000 |
|---|---|---|
| committer | dvlierop2 <dvlierop2@users.sourceforge.net> | 2007-04-17 21:26:43 +0000 |
| commit | f12da8471875838ac6cf1f8c8db16637cb97c200 (patch) | |
| tree | b5da97b8edbc054dcadf5589e04b9bb744f0b303 /src/snapper.h | |
| parent | flipping patch by maximilian albert (diff) | |
| download | inkscape-f12da8471875838ac6cf1f8c8db16637cb97c200.tar.gz inkscape-f12da8471875838ac6cf1f8c8db16637cb97c200.zip | |
Improve snapper performance (mainly in by editting WillSnapSomething())
(bzr r2917)
Diffstat (limited to 'src/snapper.h')
| -rw-r--r-- | src/snapper.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/snapper.h b/src/snapper.h index 89e4f9d72..21e96b019 100644 --- a/src/snapper.h +++ b/src/snapper.h @@ -44,7 +44,11 @@ public: bool getSnapTo(PointType t) const; ::NR::Coord getDistance() const; - bool willSnapSomething() const; + /** + * \return true if this Snapper will snap at least one kind of point. + */ + virtual bool willSnapSomething() const {return (_enabled && _snap_to != 0);} // will likely be overridden by derived classes + void setEnabled(bool s); @@ -92,6 +96,8 @@ public: std::list<SPItem const *> const &it) const; protected: SPNamedView const *_named_view; + int _snap_to; ///< bitmap of point types that we will snap to + bool _enabled; ///< true if this snapper is enabled, otherwise false private: @@ -122,8 +128,6 @@ private: std::list<SPItem const *> const &it) const = 0; ::NR::Coord _distance; ///< snap distance (desktop coordinates) - int _snap_to; ///< bitmap of point types that we will snap to - bool _enabled; ///< true if this snapper is enabled, otherwise false }; } |
