summaryrefslogtreecommitdiffstats
path: root/src/desktop.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2007-03-20 19:58:07 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2007-03-20 19:58:07 +0000
commit16768888debdb6cec38cb9ac57441c0f6c865eda (patch)
treeb405f42b79a9991e698556cd75a82cc72d866716 /src/desktop.cpp
parentformat string protection/clean up (CVE-2007-1463, CVE-2007-1464) (diff)
downloadinkscape-16768888debdb6cec38cb9ac57441c0f6c865eda.tar.gz
inkscape-16768888debdb6cec38cb9ac57441c0f6c865eda.zip
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)
Diffstat (limited to 'src/desktop.cpp')
-rw-r--r--src/desktop.cpp11
1 files changed, 11 insertions, 0 deletions
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));