diff --git a/src/snapper.cpp b/src/snapper.cpp
index 3dd58737ee015678243bed32d672ed84c2e09c31..fb7281c30bfb14647ab83f69b7cf5aa8bd4ffa8d 100644 (file)
--- a/src/snapper.cpp
+++ b/src/snapper.cpp
* 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(std::max(t, 1.0))
+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 = 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.
*/
_snap_enabled = s;
}
+void Inkscape::Snapper::setSnapVisibleOnly(bool s)
+{
+ _snap_visible_only = s;
+}
+
/*
Local Variables:
mode:c++