From: buliabyak Date: Mon, 26 Mar 2007 08:53:47 +0000 (+0000) Subject: interpret snapping distance in screen pixels independent of zoom X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ef1f6f060487b32a8d532c14794ffa93fa130ee1;p=inkscape.git interpret snapping distance in screen pixels independent of zoom --- diff --git a/src/snapper.cpp b/src/snapper.cpp index 723213afe..3d5b33c16 100644 --- a/src/snapper.cpp +++ b/src/snapper.cpp @@ -10,6 +10,8 @@ #include "libnr/nr-values.h" #include "sp-namedview.h" +#include "inkscape.h" +#include "desktop.h" Inkscape::Snapper::PointType const Inkscape::Snapper::BBOX_POINT = 0x1; Inkscape::Snapper::PointType const Inkscape::Snapper::SNAP_POINT = 0x2; @@ -37,11 +39,11 @@ void Inkscape::Snapper::setDistance(NR::Coord const d) } /** - * \return Snap distance (desktop coordinates) + * \return Snap distance (desktop coordinates); depends on current zoom so that it's always the same in screen pixels */ NR::Coord Inkscape::Snapper::getDistance() const { - return _distance; + return _distance / SP_ACTIVE_DESKTOP->current_zoom(); } /**