diff options
| author | Diederik van Lierop <mail@diedenrezi.nl> | 2007-12-12 20:34:36 +0000 |
|---|---|---|
| committer | dvlierop2 <dvlierop2@users.sourceforge.net> | 2007-12-12 20:34:36 +0000 |
| commit | f0d199b587b0a3958067a32f990f7c67587e8593 (patch) | |
| tree | b54c371ea4ec115bd781a8df5edf13fa7dba287f /src/snap.cpp | |
| parent | Fixed the filter effects dialog always displaying all the filter settings by ... (diff) | |
| download | inkscape-f0d199b587b0a3958067a32f990f7c67587e8593.tar.gz inkscape-f0d199b587b0a3958067a32f990f7c67587e8593.zip | |
Add global snapping toggle
(bzr r4221)
Diffstat (limited to 'src/snap.cpp')
| -rw-r--r-- | src/snap.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/snap.cpp b/src/snap.cpp index 1ff5d3d05..9faa4fae6 100644 --- a/src/snap.cpp +++ b/src/snap.cpp @@ -44,9 +44,9 @@ SnapManager::SnapManager(SPNamedView const *v) : guide(v, 0), object(v, 0), _named_view(v), - _include_item_center(false) -{ - + _include_item_center(false), + _snap_enabled_globally(true) +{ } @@ -92,6 +92,10 @@ SnapManager::getGridSnappers() const bool SnapManager::SomeSnapperMightSnap() const { + if (!_snap_enabled_globally) { + return false; + } + SnapperList const s = getSnappers(); SnapperList::const_iterator i = s.begin(); while (i != s.end() && (*i)->ThisSnapperMightSnap() == false) { @@ -327,7 +331,9 @@ std::pair<NR::Point, bool> SnapManager::_snapTransformed( ** appropriate transformation with `true'; otherwise we return the original scale with `false'. */ - /* Quick check to see if we have any snappers that are enabled */ + /* Quick check to see if we have any snappers that are enabled + ** Also used to globally disable all snapping + */ if (SomeSnapperMightSnap() == false) { return std::make_pair(transformation, false); } |
