Code

Monster commit. New grid infrastructure. The old gridmanagement code is still there...
[inkscape.git] / src / desktop.cpp
index ea002b872810d105bfa4e8137ba7d88f6a5e17c0..4727f3e511e564de3194df3cf7fc9a2e78eea74d 100644 (file)
@@ -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));