From f0ec9ae45a8bfc51ae487c884e5cd464b661a648 Mon Sep 17 00:00:00 2001 From: johanengelen Date: Tue, 6 May 2008 12:06:43 +0000 Subject: [PATCH] xy-grid: when shown as dots, add emphasis using crosses. --- src/display/canvas-grid.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/display/canvas-grid.cpp b/src/display/canvas-grid.cpp index 83eed0772..2bc57784d 100644 --- a/src/display/canvas-grid.cpp +++ b/src/display/canvas-grid.cpp @@ -887,8 +887,8 @@ CanvasXYGrid::Render (SPCanvasBuf *buf) //set correct coloring, depending preference (when zoomed out, always major coloring or minor coloring) guint32 _empcolor; - bool preference = prefs_get_int_attribute ("options.grids", "no_emphasize_when_zoomedout", 0) == 1; - if( (scaled[NR::X] || scaled[NR::Y]) && preference ) { + bool no_emp_when_zoomed_out = prefs_get_int_attribute ("options.grids", "no_emphasize_when_zoomedout", 0) == 1; + if( (scaled[NR::X] || scaled[NR::Y]) && no_emp_when_zoomed_out ) { _empcolor = color; } else { _empcolor = empcolor; @@ -927,11 +927,19 @@ CanvasXYGrid::Render (SPCanvasBuf *buf) for (x = sxg, xlinenum = xlinestart; x < buf->rect.x1; x += sw[NR::X], xlinenum++) { gint const ix = (gint) Inkscape::round(x); if ( (!scaled[NR::X] && (xlinenum % empspacing) != 0) - || (!scaled[NR::Y] && (ylinenum % empspacing) != 0) ) + || (!scaled[NR::Y] && (ylinenum % empspacing) != 0) + || ((scaled[NR::X] || scaled[NR::Y]) && no_emp_when_zoomed_out) ) { grid_dot (buf, ix, iy, color | (guint32)0x000000FF); // put alpha to max value } else { + gint const pitch = 1; + grid_dot (buf, ix-pitch, iy, _empcolor); + grid_dot (buf, ix+pitch, iy, _empcolor); + grid_dot (buf, ix, iy, _empcolor | (guint32)0x000000FF); // put alpha to max value + + grid_dot (buf, ix, iy-pitch, _empcolor); + grid_dot (buf, ix, iy+pitch, _empcolor); } } -- 2.30.2