diff options
| author | Matthew Petroff <matthew@mpetroff.net> | 2013-08-25 23:42:22 +0000 |
|---|---|---|
| committer | Matthew Petroff <matthew@mpetroff.net> | 2013-08-25 23:42:22 +0000 |
| commit | 77f61343ff18f29f05331131c2fe2bd810a64498 (patch) | |
| tree | 9fe41722d2228560f34db2119ca4f6bed26c9704 /src/ui/dialog/document-properties.cpp | |
| parent | Merge bool fix and clean up the warning (diff) | |
| download | inkscape-77f61343ff18f29f05331131c2fe2bd810a64498.tar.gz inkscape-77f61343ff18f29f05331131c2fe2bd810a64498.zip | |
Use real world units for page sizes.
(bzr r12475.1.1)
Diffstat (limited to 'src/ui/dialog/document-properties.cpp')
| -rw-r--r-- | src/ui/dialog/document-properties.cpp | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp index 77fb182e5..430f28474 100644 --- a/src/ui/dialog/document-properties.cpp +++ b/src/ui/dialog/document-properties.cpp @@ -1433,9 +1433,33 @@ void DocumentProperties::update() if (nv->doc_units) _rum_deflt.setUnit (nv->doc_units->abbr); - double const doc_w_px = sp_desktop_document(dt)->getWidth(); - double const doc_h_px = sp_desktop_document(dt)->getHeight(); - _page_sizer.setDim (doc_w_px, doc_h_px); + double const doc_w = sp_desktop_document(dt)->getRoot()->width.value; + Glib::ustring doc_w_unit = unit_table.getUnit(sp_desktop_document(dt)->getRoot()->width.unit).abbr; + if (doc_w_unit == "") { + if (nv->units) { + doc_w_unit = nv->units->abbr; + } else { + if (nv->doc_units) { + doc_w_unit = nv->doc_units->abbr; + } else { + doc_w_unit = "px"; + } + } + } + double const doc_h = sp_desktop_document(dt)->getRoot()->height.value; + Glib::ustring doc_h_unit = unit_table.getUnit(sp_desktop_document(dt)->getRoot()->height.unit).abbr; + if (doc_h_unit == "") { + if (nv->units) { + doc_h_unit = nv->units->abbr; + } else { + if (nv->doc_units) { + doc_h_unit = nv->doc_units->abbr; + } else { + doc_h_unit = "px"; + } + } + } + _page_sizer.setDim(Inkscape::Util::Quantity(doc_w, doc_w_unit), Inkscape::Util::Quantity(doc_h, doc_h_unit)); _page_sizer.updateFitMarginsUI(nv->getRepr()); //-----------------------------------------------------------guide page |
