Code

Use "%"-key for toggling the snapper, and modify the related sp-desktop code
[inkscape.git] / src / desktop.cpp
index d31babf87cb1f365a0dfe11e95353fc912ace79d..feb3f5cb0287ece3a51a8a05af074332473f98c4 100644 (file)
@@ -1212,6 +1212,12 @@ void SPDesktop::showGrids(bool show, bool dirty_document)
     }
 }
 
+void SPDesktop::toggleSnapping()
+{
+    bool v = namedview->snap_manager.getSnapEnabledGlobally();
+    Inkscape::XML::Node *repr = SP_OBJECT_REPR(namedview);
+    sp_repr_set_boolean(repr, "inkscape:snap-global", !v);
+}
 
 //----------------------------------------------------------------------
 // Callback implementations. The virtual ones are connected by the view.