diff options
Diffstat (limited to 'src/snap.cpp')
| -rw-r--r-- | src/snap.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/snap.cpp b/src/snap.cpp index 4727c7b3e..9ee575e22 100644 --- a/src/snap.cpp +++ b/src/snap.cpp @@ -214,6 +214,22 @@ Inkscape::SnappedPoint SnapManager::freeSnap(Inkscape::SnapCandidatePoint const return findBestSnap(p, sc, false); } +void SnapManager::preSnap(Inkscape::SnapCandidatePoint const &p) +{ + // setup() must have been called before calling this method! + + if (_snapindicator) { + _snapindicator = false; // prevent other methods from drawing a snap indicator; we want to control this here + Inkscape::SnappedPoint s = freeSnap(p); + if (s.getSnapped()) { + _desktop->snapindicator->set_new_snaptarget(s, true); + } else { + _desktop->snapindicator->remove_snaptarget(); + } + _snapindicator = true; // restore the original value + } +} + /** * \brief Snap to the closest multiple of a grid pitch * |
