summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a73302a)
raw | patch | inline | side by side (parent: a73302a)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Sun, 16 Dec 2007 18:24:26 +0000 (18:24 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Sun, 16 Dec 2007 18:24:26 +0000 (18:24 +0000) |
src/display/canvas-axonomgrid.cpp | patch | blob | history | |
src/display/canvas-grid.cpp | patch | blob | history |
index 7fdc24192430deaf1f298ccd2c51d910e095227d..33592a3f871aa85562c9ebc5c82be4c4161ad55d 100644 (file)
@@ -195,16 +195,18 @@ attach_all(Gtk::Table &table, Gtk::Widget const *const arr[], unsigned size, int
CanvasAxonomGrid::CanvasAxonomGrid (SPNamedView * nv, Inkscape::XML::Node * in_repr, SPDocument * in_doc)
: CanvasGrid(nv, in_repr, in_doc, GRID_AXONOMETRIC), table(1, 1)
{
- origin[NR::X] = prefs_get_double_attribute ("options.grids.axonom", "origin_x", 0.0);
- origin[NR::Y] = prefs_get_double_attribute ("options.grids.axonom", "origin_y", 0.0);
+ gridunit = sp_unit_get_by_abbreviation( prefs_get_string_attribute("options.grids.axonom", "units") );
+ if (!gridunit)
+ gridunit = &sp_unit_get_by_id(SP_UNIT_PX);
+ origin[NR::X] = sp_units_get_pixels( prefs_get_double_attribute ("options.grids.axonom", "origin_x", 0.0), *(gridunit) );
+ origin[NR::Y] = sp_units_get_pixels( prefs_get_double_attribute ("options.grids.axonom", "origin_y", 0.0), *(gridunit) );
color = prefs_get_int_attribute("options.grids.axonom", "color", 0x0000ff20);
empcolor = prefs_get_int_attribute("options.grids.axonom", "empcolor", 0x0000ff40);
empspacing = prefs_get_int_attribute("options.grids.axonom", "empspacing", 5);
- gridunit = sp_unit_get_by_abbreviation( prefs_get_string_attribute("options.grids.axonom", "units") );
- lengthy = prefs_get_double_attribute ("options.grids.axonom", "spacing_y", 1.0);
+ lengthy = sp_units_get_pixels( prefs_get_double_attribute ("options.grids.axonom", "spacing_y", 1.0), *(gridunit) );
angle_deg[X] = prefs_get_double_attribute ("options.grids.axonom", "angle_x", 30.0);
angle_deg[Z] = prefs_get_double_attribute ("options.grids.axonom", "angle_z", 30.0);
- angle_deg[Y] =0;
+ angle_deg[Y] = 0;
angle_rad[X] = deg_to_rad(angle_deg[X]);
tan_angle[X] = tan(angle_rad[X]);
index ce30960fb82f37dc270e06a16149f025160b22cc..021a62f96e8212e15dce9ef7fc5c1def64263f1b 100644 (file)
@@ -391,14 +391,16 @@ 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] = 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);
+ gridunit = sp_unit_get_by_abbreviation( prefs_get_string_attribute("options.grids.xy", "units") );
+ if (!gridunit)
+ gridunit = &sp_unit_get_by_id(SP_UNIT_PX);
+ origin[NR::X] = sp_units_get_pixels( prefs_get_double_attribute ("options.grids.xy", "origin_x", 0.0), *(gridunit) );
+ origin[NR::Y] = sp_units_get_pixels( prefs_get_double_attribute ("options.grids.xy", "origin_y", 0.0), *(gridunit) );
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_abbreviation( prefs_get_string_attribute("options.grids.xy", "units") );
+ spacing[NR::X] = sp_units_get_pixels( prefs_get_double_attribute ("options.grids.xy", "spacing_x", 0.0), *(gridunit) );
+ spacing[NR::Y] = sp_units_get_pixels( prefs_get_double_attribute ("options.grids.xy", "spacing_y", 0.0), *(gridunit) );
render_dotted = prefs_get_int_attribute ("options.grids.xy", "dotted", 0) == 1;
snapper = new CanvasXYGridSnapper(this, namedview, 0);