diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2008-01-14 23:30:00 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2008-01-14 23:30:00 +0000 |
| commit | f3028fd60b35ae3e73fe00e0c10e151c2ba78995 (patch) | |
| tree | 1aae792fc416d20b22ff6b2a7dbf1666866b3539 /src | |
| parent | W3C licensing: (diff) | |
| download | inkscape-f3028fd60b35ae3e73fe00e0c10e151c2ba78995.tar.gz inkscape-f3028fd60b35ae3e73fe00e0c10e151c2ba78995.zip | |
Add preference so people can choose which behaviour they want. (bug 167422)
(bzr r4485)
Diffstat (limited to 'src')
| -rw-r--r-- | src/display/canvas-grid.cpp | 16 | ||||
| -rw-r--r-- | src/preferences-skeleton.h | 3 | ||||
| -rw-r--r-- | src/ui/dialog/inkscape-preferences.cpp | 2 | ||||
| -rw-r--r-- | src/ui/dialog/inkscape-preferences.h | 1 |
4 files changed, 17 insertions, 5 deletions
diff --git a/src/display/canvas-grid.cpp b/src/display/canvas-grid.cpp index 0edcbd0ab..b6897ae48 100644 --- a/src/display/canvas-grid.cpp +++ b/src/display/canvas-grid.cpp @@ -833,16 +833,24 @@ CanvasXYGrid::Render (SPCanvasBuf *buf) gdouble const syg = floor ((buf->rect.y0 - ow[NR::Y]) / sw[NR::Y]) * sw[NR::Y] + ow[NR::Y]; gint const ylinestart = (gint) Inkscape::round((syg - ow[NR::Y]) / sw[NR::Y]); + //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 ) { + _empcolor = color; + } else { + _empcolor = empcolor; + } + if (!render_dotted) { gint ylinenum; gdouble y; for (y = syg, ylinenum = ylinestart; y < buf->rect.y1; y += sw[NR::Y], ylinenum++) { gint const y0 = (gint) Inkscape::round(y); - if (!scaled[NR::Y] && (ylinenum % empspacing) != 0) { grid_hline (buf, y0, buf->rect.x0, buf->rect.x1 - 1, color); } else { - grid_hline (buf, y0, buf->rect.x0, buf->rect.x1 - 1, empcolor); + grid_hline (buf, y0, buf->rect.x0, buf->rect.x1 - 1, _empcolor); } } @@ -853,7 +861,7 @@ CanvasXYGrid::Render (SPCanvasBuf *buf) if (!scaled[NR::X] && (xlinenum % empspacing) != 0) { grid_vline (buf, ix, buf->rect.y0, buf->rect.y1, color); } else { - grid_vline (buf, ix, buf->rect.y0, buf->rect.y1, empcolor); + grid_vline (buf, ix, buf->rect.y0, buf->rect.y1, _empcolor); } } } else { @@ -869,7 +877,7 @@ CanvasXYGrid::Render (SPCanvasBuf *buf) if ( (!scaled[NR::X] && (xlinenum % empspacing) == 0) || (!scaled[NR::Y] && (ylinenum % empspacing) == 0) ) { - grid_dot (buf, ix, iy, empcolor | (guint32)0x000000FF); // put alpha to max value + grid_dot (buf, ix, iy, _empcolor | (guint32)0x000000FF); // put alpha to max value } else { grid_dot (buf, ix, iy, color | (guint32)0x000000FF); // put alpha to max value } diff --git a/src/preferences-skeleton.h b/src/preferences-skeleton.h index 825bf37bd..f2b217fd4 100644 --- a/src/preferences-skeleton.h +++ b/src/preferences-skeleton.h @@ -246,7 +246,8 @@ static char const preferences_skeleton[] = " masks=\"65535\"/>\n" // 0x0000ffff " <group id=\"svgoutput\" usenamedcolors=\"0\" numericprecision=\"8\" minimumexponent=\"-8\" inlineattrs=\"0\" indent=\"2\"/>\n" " <group id=\"forkgradientvectors\" value=\"1\"/>\n" -" <group id=\"grids\">" +" <group id=\"grids\"" +" no_emphasize_when_zoomedout=\"0\">\n" " <group id=\"xy\" " " units=\"px\"\n" " origin_x=\"0.0\"\n" diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index b07914265..d0fb56f97 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -807,6 +807,8 @@ void InkscapePreferences::initPageGrids() { _page_grids.add_group_header( _("Default grid settings")); + _grids_no_emphasize_on_zoom.init( _("Don't emphasize gridlines when zoomed out"), "options.grids", "no_emphasize_when_zoomedout", false); + _page_grids.add_line( false, "", _grids_no_emphasize_on_zoom, "", _("If set and zoomed out, the gridlines will be shown in normal color instead of major grid line color."), false); _page_grids.add_line( false, "", _grids_notebook, "", "", false); _grids_notebook.append_page(_grids_xy, CanvasGrid::getName( GRID_RECTANGULAR )); _grids_notebook.append_page(_grids_axonom, CanvasGrid::getName( GRID_AXONOMETRIC )); diff --git a/src/ui/dialog/inkscape-preferences.h b/src/ui/dialog/inkscape-preferences.h index fd340769e..607953802 100644 --- a/src/ui/dialog/inkscape-preferences.h +++ b/src/ui/dialog/inkscape-preferences.h @@ -177,6 +177,7 @@ protected: PrefCheckButton _cms_proof_preserveblack; Gtk::Notebook _grids_notebook; + PrefCheckButton _grids_no_emphasize_on_zoom; DialogPage _grids_xy, _grids_axonom; // CanvasXYGrid properties: PrefUnit _grids_xy_units; |
