From 7d5f0a04176639e4428acee949c96f3ec8a89909 Mon Sep 17 00:00:00 2001 From: johanengelen Date: Sun, 17 Sep 2006 17:46:38 +0000 Subject: [PATCH] Changed grid drawing (nit more logical): hlines and vlines are drawn completely independent (removed nested for-loops). --- src/display/canvas-grid.cpp | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/display/canvas-grid.cpp b/src/display/canvas-grid.cpp index 9fb6974f8..4d8f08971 100644 --- a/src/display/canvas-grid.cpp +++ b/src/display/canvas-grid.cpp @@ -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); } } } -- 2.30.2