diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2008-05-06 12:06:43 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2008-05-06 12:06:43 +0000 |
| commit | cb8194af4b8dd10cebea74fd03b5fc1e0c28f417 (patch) | |
| tree | e5c1a6e8deff019757666456146863f07b207ee2 /src/display/canvas-grid.cpp | |
| parent | Fix a regression in the SVG path data parser (it will now parse things like "... (diff) | |
| download | inkscape-cb8194af4b8dd10cebea74fd03b5fc1e0c28f417.tar.gz inkscape-cb8194af4b8dd10cebea74fd03b5fc1e0c28f417.zip | |
xy-grid: when shown as dots, add emphasis using crosses.
(bzr r5619)
Diffstat (limited to 'src/display/canvas-grid.cpp')
| -rw-r--r-- | src/display/canvas-grid.cpp | 14 |
1 files 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); } } |
