From 16768888debdb6cec38cb9ac57441c0f6c865eda Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Tue, 20 Mar 2007 19:58:07 +0000 Subject: Monster commit. New grid infrastructure. The old gridmanagement code is still there; this committed for testing purposes. Goal is to delete the old grid code later on. (bzr r2721) --- src/desktop.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/desktop.cpp') diff --git a/src/desktop.cpp b/src/desktop.cpp index ea002b872..4727f3e51 100644 --- a/src/desktop.cpp +++ b/src/desktop.cpp @@ -83,6 +83,7 @@ #include "message-context.h" #include "layer-manager.h" #include "event-log.h" +#include "display/canvas-grid.h" namespace Inkscape { namespace XML { class Node; }} @@ -1407,12 +1408,22 @@ _update_snap_distances (SPDesktop *desktop) SPNamedView &nv = *desktop->namedview; + + // FIXME GRID: make one gridsnapper object that snaps to all enabled grids by calling their snappers. nv.snap_manager.grid.setDistance(sp_convert_distance_full(nv.gridtolerance, *nv.gridtoleranceunit, px)); nv.snap_manager.axonomgrid.setDistance(sp_convert_distance_full(nv.gridtolerance, *nv.gridtoleranceunit, px)); + //new grid snappers + for ( GSList const *l = nv.grids; l != NULL; l = l->next) { + Inkscape::CanvasGrid *grid = (Inkscape::CanvasGrid*) l->data; + grid->snapper->setDistance(sp_convert_distance_full(nv.gridtolerance, + *nv.gridtoleranceunit, + px)); + } + nv.snap_manager.guide.setDistance(sp_convert_distance_full(nv.guidetolerance, *nv.guidetoleranceunit, px)); -- cgit v1.2.3