summaryrefslogtreecommitdiffstats
path: root/src/snap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/snap.cpp')
-rw-r--r--src/snap.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/snap.cpp b/src/snap.cpp
index a6c4b8729..24cfefe0b 100644
--- a/src/snap.cpp
+++ b/src/snap.cpp
@@ -108,6 +108,25 @@ bool SnapManager::someSnapperMightSnap() const
}
/**
+ * \return true if one of the snappers will try to snap something.
+ */
+
+bool SnapManager::gridSnapperMightSnap() const
+{
+ if ( !snapprefs.getSnapEnabledGlobally() || snapprefs.getSnapPostponedGlobally() ) {
+ return false;
+ }
+
+ SnapperList const s = getGridSnappers();
+ SnapperList::const_iterator i = s.begin();
+ while (i != s.end() && (*i)->ThisSnapperMightSnap() == false) {
+ i++;
+ }
+
+ return (i != s.end());
+}
+
+/**
* Try to snap a point to any of the specified snappers.
*
* \param point_type Type of point.