diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2015-03-01 22:24:25 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx.marker.es> | 2015-03-01 22:24:25 +0000 |
| commit | 2277d3fa41c2fd311a28ac47ffa6361c0479b8ee (patch) | |
| tree | 44f64d417a9b5b0f473d2f06081bdc331929be19 /src/sp-namedview.cpp | |
| parent | added mirror knots (diff) | |
| parent | Match function definition and declaration syntax. Mismatch pointed out by dox... (diff) | |
| download | inkscape-2277d3fa41c2fd311a28ac47ffa6361c0479b8ee.tar.gz inkscape-2277d3fa41c2fd311a28ac47ffa6361c0479b8ee.zip | |
update to trunk
(bzr r13645.1.27)
Diffstat (limited to 'src/sp-namedview.cpp')
| -rw-r--r-- | src/sp-namedview.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/sp-namedview.cpp b/src/sp-namedview.cpp index c26eff39f..3154c9e7b 100644 --- a/src/sp-namedview.cpp +++ b/src/sp-namedview.cpp @@ -261,6 +261,8 @@ void SPNamedView::build(SPDocument *document, Inkscape::XML::Node *repr) { Geom::Rect viewbox = document->getRoot()->viewBox; double factor = svgwidth.value(unit_table.primary(Inkscape::Util::UNIT_TYPE_LINEAR)) / viewbox.width(); svg_units = unit_table.findUnit(factor, Inkscape::Util::UNIT_TYPE_LINEAR); + } else { // force the document units to be px + repr->setAttribute("inkscape:document-units", "px"); } } @@ -551,7 +553,7 @@ void SPNamedView::set(unsigned int key, const gchar* value) { static Inkscape::Util::Unit const *px = unit_table.getUnit("px"); Inkscape::Util::Unit const *new_unit = px; - if (value) { + if (value && document->getRoot()->viewBox_set) { Inkscape::Util::Unit const *const req_unit = unit_table.getUnit(value); if ( !unit_table.hasUnit(value) ) { g_warning("Unrecognized unit `%s'", value); |
