diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2006-09-17 17:46:38 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2006-09-17 17:46:38 +0000 |
| commit | a919b157a3d569b6a124082b185db16e7c10bc86 (patch) | |
| tree | a278fb5418ef896b78b52e5219b829801e7b3cc5 /src/display/canvas-grid.cpp | |
| parent | When an object is selected and Alt is pressed: now the cursor changes to the ... (diff) | |
| download | inkscape-a919b157a3d569b6a124082b185db16e7c10bc86.tar.gz inkscape-a919b157a3d569b6a124082b185db16e7c10bc86.zip | |
Changed grid drawing (nit more logical): hlines and vlines are drawn completely independent (removed nested for-loops).
(bzr r1711)
Diffstat (limited to 'src/display/canvas-grid.cpp')
| -rw-r--r-- | src/display/canvas-grid.cpp | 25 |
1 files 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); } } } |
