summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ffa6fea)
raw | patch | inline | side by side (parent: ffa6fea)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Mon, 4 Feb 2008 19:04:56 +0000 (19:04 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Mon, 4 Feb 2008 19:04:56 +0000 (19:04 +0000) |
src/display/canvas-axonomgrid.cpp | patch | blob | history | |
src/display/canvas-grid.cpp | patch | blob | history | |
src/ui/dialog/inkscape-preferences.cpp | patch | blob | history |
index e494ac9ddc6c3231972a2e3db533165443f0b85b..79e301b7350d707b2106d1ced3cd75bfbb021c7e 100644 (file)
#define CANVAS_AXONOMGRID_C
/*
- * Copyright (C) 2006-2007 Johan Engelen <johan@shouraizou.nl>
+ * Copyright (C) 2006-2008 Johan Engelen <johan@shouraizou.nl>
*/
/*
* axes are bound to a certain range of angles. The z-axis always has an angle
* smaller than 90 degrees (measured from horizontal, 0 degrees being a line extending
* to the right). The x-axis will always have an angle between 0 and 90 degrees.
- * When I quickly think about it: all possibilities are probably covered this way. Eg.
- * a z-axis with negative angle can be replaced with an x-axis, etc.
*/
/*
void
CanvasAxonomGrid::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 && preference ) {
+ _empcolor = color;
+ } else {
+ _empcolor = empcolor;
+ }
+
// gc = gridcoordinates (the coordinates calculated from the grids origin 'grid->ow'.
// sc = screencoordinates ( for example "buf->rect.x0" is in screencoordinates )
// bc = buffer patch coordinates
gint const x1 = x0 + (gint) Inkscape::round( (buf->rect.y1 - y) / tan_angle[X] );
gint const y1 = buf->rect.y1;
- if (!scaled && (xlinenum % empspacing) == 0) {
- sp_caxonomgrid_drawline (buf, x0, y0, x1, y1, empcolor);
- } else {
+ if (!scaled && (xlinenum % empspacing) != 0) {
sp_caxonomgrid_drawline (buf, x0, y0, x1, y1, color);
+ } else {
+ sp_caxonomgrid_drawline (buf, x0, y0, x1, y1, _empcolor);
}
}
// lines starting from top side
gint const x0 = (gint) Inkscape::round(x);
gint const x1 = x0 + (gint) Inkscape::round( (y1 - y0) / tan_angle[X] );
- if (!scaled && (xlinenum % empspacing) == 0) {
- sp_caxonomgrid_drawline (buf, x0, y0, x1, y1, empcolor);
- } else {
+ if (!scaled && (xlinenum % empspacing) != 0) {
sp_caxonomgrid_drawline (buf, x0, y0, x1, y1, color);
+ } else {
+ sp_caxonomgrid_drawline (buf, x0, y0, x1, y1, _empcolor);
}
}
for (x = ystart_x_sc; x < buf->rect.x1; x += spacing_ylines, ylinenum++) {
gint const x0 = (gint) Inkscape::round(x);
- if (!scaled && (ylinenum % empspacing) == 0) {
- sp_grid_vline (buf, x0, buf->rect.y0, buf->rect.y1 - 1, empcolor);
- } else {
+ if (!scaled && (ylinenum % empspacing) != 0) {
sp_grid_vline (buf, x0, buf->rect.y0, buf->rect.y1 - 1, color);
+ } else {
+ sp_grid_vline (buf, x0, buf->rect.y0, buf->rect.y1 - 1, _empcolor);
}
}
gint const x1 = x0 + (gint) Inkscape::round( (y - buf->rect.y0 ) / tan_angle[Z] );
gint const y1 = buf->rect.y0;
- if (!scaled && (zlinenum % empspacing) == 0) {
- sp_caxonomgrid_drawline (buf, x0, y0, x1, y1, empcolor);
- } else {
+ if (!scaled && (zlinenum % empspacing) != 0) {
sp_caxonomgrid_drawline (buf, x0, y0, x1, y1, color);
+ } else {
+ sp_caxonomgrid_drawline (buf, x0, y0, x1, y1, _empcolor);
}
}
// draw lines from bottom-up
gint const x0 = (gint) Inkscape::round(x);
gint const x1 = x0 + (gint) Inkscape::round( (buf->rect.y1 - buf->rect.y0) / tan_angle[Z] );
- if (!scaled && (zlinenum % empspacing) == 0) {
- sp_caxonomgrid_drawline (buf, x0, y0, x1, y1, empcolor);
- } else {
+ if (!scaled && (zlinenum % empspacing) != 0) {
sp_caxonomgrid_drawline (buf, x0, y0, x1, y1, color);
+ } else {
+ sp_caxonomgrid_drawline (buf, x0, y0, x1, y1, _empcolor);
}
}
}
index f4f23764a33e0b90c4dd013258de637a62c55cc1..d31eb15c4a60999831fa6e6cbd0b2d2a0942277d 100644 (file)
gdouble x;
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) )
+ 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, color | (guint32)0x000000FF); // put alpha to max value
} else {
- grid_dot (buf, ix, iy, color | (guint32)0x000000FF); // put alpha to max value
+ grid_dot (buf, ix, iy, _empcolor | (guint32)0x000000FF); // put alpha to max value
}
}
index efa461d5535626a1316c315d00c30fade1c9f6e6..a6927dc98a7ddf716548f0b5cc134072f92053dd 100644 (file)
void InkscapePreferences::initPageGrids()
{
- _page_grids.add_group_header( _("Default grid settings"));
+ _page_grids.add_group_header( _("Major grid line emphasizing"));
_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_group_header( _("Default grid settings"));
+
_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 ));