Code

Changed grid drawing (nit more logical): hlines and vlines are drawn completely indep...
authorjohanengelen <johanengelen@users.sourceforge.net>
Sun, 17 Sep 2006 17:46:38 +0000 (17:46 +0000)
committerjohanengelen <johanengelen@users.sourceforge.net>
Sun, 17 Sep 2006 17:46:38 +0000 (17:46 +0000)
src/display/canvas-grid.cpp

index 9fb6974f8e8878ccf4179d2f2eb10cd69abe124d..4d8f089712719b6e9cb3f8df01c18b949aa749d3 100644 (file)
@@ -231,25 +231,22 @@ sp_cgrid_render (SPCanvasItem * item, SPCanvasBuf * buf)
     gdouble y;
     for (y = syg, ylinenum = ylinestart; y < buf->rect.y1; y += grid->sw[NR::Y], ylinenum++) {
         const gint y0 = (gint) Inkscape::round(y);
-        const gint y1 = (gint) Inkscape::round(y + grid->sw[NR::Y]);
 
-        if (!grid->scaled[NR::Y] &&
-                (ylinenum % grid->empspacing) == 0) {
+        if (!grid->scaled[NR::Y] && (ylinenum % grid->empspacing) == 0) {
             sp_grid_hline (buf, y0, buf->rect.x0, buf->rect.x1 - 1, grid->empcolor);
         } else {
             sp_grid_hline (buf, y0, buf->rect.x0, buf->rect.x1 - 1, grid->color);
         }
-
-        gint xlinenum;
-        gdouble x;
-        for (x = sxg, xlinenum = xlinestart; x < buf->rect.x1; x += grid->sw[NR::X], xlinenum++) {
-            const gint ix = (gint) Inkscape::round(x);
-            if (!grid->scaled[NR::X] &&
-                    (xlinenum % grid->empspacing) == 0) {
-                sp_grid_vline (buf, ix, y0 + 1, y1 - 1, grid->empcolor);
-            } else {
-                sp_grid_vline (buf, ix, y0 + 1, y1 - 1, grid->color);
-            }
+    }     
+
+    gint xlinenum;
+    gdouble x;
+    for (x = sxg, xlinenum = xlinestart; x < buf->rect.x1; x += grid->sw[NR::X], xlinenum++) {
+        const gint ix = (gint) Inkscape::round(x);
+        if (!grid->scaled[NR::X] && (xlinenum % grid->empspacing) == 0) {
+            sp_grid_vline (buf, ix, buf->rect.y0, buf->rect.y1, grid->empcolor);
+        } else {
+            sp_grid_vline (buf, ix, buf->rect.y0, buf->rect.y1, grid->color);
         }
     }
 }