summaryrefslogtreecommitdiffstats
path: root/src/display/canvas-grid.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2007-12-14 18:46:47 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2007-12-14 18:46:47 +0000
commiteb87dc10b67de267764b3fac83b00b89d93b98ad (patch)
tree4504a1ed05da4a24409af43adfcf6c855ad96cca /src/display/canvas-grid.cpp
parentupdate to latest 2geom (diff)
downloadinkscape-eb87dc10b67de267764b3fac83b00b89d93b98ad.tar.gz
inkscape-eb87dc10b67de267764b3fac83b00b89d93b98ad.zip
Add default grid settings to Inkscape preferences.
(bzr r4230)
Diffstat (limited to 'src/display/canvas-grid.cpp')
-rw-r--r--src/display/canvas-grid.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/display/canvas-grid.cpp b/src/display/canvas-grid.cpp
index d4a78f265..da16bb85e 100644
--- a/src/display/canvas-grid.cpp
+++ b/src/display/canvas-grid.cpp
@@ -29,15 +29,13 @@
#include "desktop.h"
#include "../document.h"
+#include "prefs-utils.h"
#include "canvas-grid.h"
#include "canvas-axonomgrid.h"
namespace Inkscape {
-#define DEFAULTGRIDCOLOR 0x0000FF20
-#define DEFAULTGRIDEMPCOLOR 0x0000FF40
-
static gchar const *const grid_name[] = {
N_("Rectangular grid"),
N_("Axonometric grid")
@@ -393,13 +391,15 @@ attach_all(Gtk::Table &table, Gtk::Widget const *const arr[], unsigned size, int
CanvasXYGrid::CanvasXYGrid (SPNamedView * nv, Inkscape::XML::Node * in_repr, SPDocument * in_doc)
: CanvasGrid(nv, in_repr, in_doc, GRID_RECTANGULAR), table(1, 1)
{
- origin[NR::X] = origin[NR::Y] = 0.0;
- color = DEFAULTGRIDCOLOR;
- empcolor = DEFAULTGRIDEMPCOLOR;
- empspacing = 5;
- spacing[NR::X] = spacing[NR::Y] = 1.0;
+ origin[NR::X] = prefs_get_double_attribute ("options.grids.xy", "origin_x", 0.0);
+ origin[NR::Y] = prefs_get_double_attribute ("options.grids.xy", "origin_y", 0.0);
+ color = prefs_get_int_attribute("options.grids.xy", "color", 0x0000ff20);
+ empcolor = prefs_get_int_attribute("options.grids.xy", "empcolor", 0x0000ff40);
+ empspacing = prefs_get_int_attribute("options.grids.xy", "empspacing", 5);
+ spacing[NR::X] = prefs_get_double_attribute ("options.grids.xy", "spacing_x", 0.0);
+ spacing[NR::Y] = prefs_get_double_attribute ("options.grids.xy", "spacing_y", 0.0);
gridunit = &sp_unit_get_by_id(SP_UNIT_PX);
- render_dotted = false;
+ render_dotted = prefs_get_int_attribute ("options.grids.xy", "dotted", 0) == 1;
snapper = new CanvasXYGridSnapper(this, namedview, 0);