Code

Merge from trunk.
[inkscape.git] / src / snapper.cpp
index 7e45681602f293e19f8774a5b234f8913014ece1..fb7281c30bfb14647ab83f69b7cf5aa8bd4ffa8d 100644 (file)
@@ -9,7 +9,6 @@
  *  Released under GNU GPL, read the file 'COPYING' for more information.
  */
 
-#include "libnr/nr-values.h"
 #include "sp-namedview.h"
 #include "inkscape.h"
 #include "desktop.h"
  *  \param nv Named view.
  *  \param d Snap tolerance.
  */
-Inkscape::Snapper::Snapper(SnapManager const *sm, Geom::Coord const t) : 
-       _snapmanager(sm), 
-       _snap_enabled(true),
-       _snapper_tolerance(t)
+Inkscape::Snapper::Snapper(SnapManager *sm, Geom::Coord const /*t*/) :
+    _snapmanager(sm),
+    _snap_enabled(true),
+    _snap_visible_only(true)
 {
     g_assert(_snapmanager != NULL);
 }
 
-/**
- *  Set snap tolerance.
- *  \param d New snap tolerance (desktop coordinates)
- */
-void Inkscape::Snapper::setSnapperTolerance(Geom::Coord const d)
-{
-    _snapper_tolerance = d;
-}
-
-/**
- *  \return Snap tolerance (desktop coordinates); depends on current zoom so that it's always the same in screen pixels
- */
-Geom::Coord Inkscape::Snapper::getSnapperTolerance() const
-{
-    return _snapper_tolerance / SP_ACTIVE_DESKTOP->current_zoom();
-}
-
-bool Inkscape::Snapper::getSnapperAlwaysSnap() const
-{
-    return _snapper_tolerance == 10000; //TODO: Replace this threshold of 10000 by a constant; see also tolerance-slider.cpp
-}
-
 /**
  *  \param s true to enable this snapper, otherwise false.
  */
@@ -58,6 +35,11 @@ void Inkscape::Snapper::setEnabled(bool s)
     _snap_enabled = s;
 }
 
+void Inkscape::Snapper::setSnapVisibleOnly(bool s)
+{
+    _snap_visible_only = s;
+}
+
 /*
   Local Variables:
   mode:c++