Code

Make curvature work again by fixing a minor omission
[inkscape.git] / src / snapper.cpp
index 492e4ca4d019b4da14ac7a72094b470f78fa4504..751b663e30f8393fbc83dc0d5f211a6fc892abe1 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 *sm, Geom::Coord const t) :
+Inkscape::Snapper::Snapper(SnapManager *sm, Geom::Coord const /*t*/) :
        _snapmanager(sm),
        _snap_enabled(true),
-       _snapper_tolerance(std::max(t, 1.0))
+       _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 = std::max(d, 1.0);
-}
-
-/**
- *  \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
-{
-       SPDesktop const *dt = _snapmanager->getDesktop();
-       double const zoom =  dt ? dt->current_zoom() : 1;
-       return _snapper_tolerance / 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.
  */
@@ -60,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++