Code

Don't use SP_ACTIVE_DESKTOP
authordvlierop2 <dvlierop2@users.sourceforge.net>
Sun, 23 Nov 2008 19:39:52 +0000 (19:39 +0000)
committerdvlierop2 <dvlierop2@users.sourceforge.net>
Sun, 23 Nov 2008 19:39:52 +0000 (19:39 +0000)
src/snapper.cpp

index 79f30fa3ce4eb7bea27517b97f6eab8e2b5c66e6..3dd58737ee015678243bed32d672ed84c2e09c31 100644 (file)
@@ -41,7 +41,9 @@ void Inkscape::Snapper::setSnapperTolerance(Geom::Coord const d)
  */
 Geom::Coord Inkscape::Snapper::getSnapperTolerance() const
 {
-    return _snapper_tolerance / SP_ACTIVE_DESKTOP->current_zoom();
+       SPDesktop const *dt = _snapmanager->getDesktop();
+       double const zoom =  dt ? dt->current_zoom() : 1;
+       return _snapper_tolerance / zoom;
 }
 
 bool Inkscape::Snapper::getSnapperAlwaysSnap() const