summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/document-properties.cpp
diff options
context:
space:
mode:
authorAlvin Penner <penner@vaxxine.com>2014-02-17 18:53:01 +0000
committerapenner <penner@vaxxine.com>2014-02-17 18:53:01 +0000
commitae57812b967d6d67ecb223537216e98d055c170e (patch)
tree27605cb28484e6faec69354e425dc43327d59160 /src/ui/dialog/document-properties.cpp
parentDoc. Changelog file updated (see Bug #637034). (diff)
downloadinkscape-ae57812b967d6d67ecb223537216e98d055c170e.tar.gz
inkscape-ae57812b967d6d67ecb223537216e98d055c170e.zip
scaling of viewBox on document unit change (Bug 1236257)
Fixed bugs: - https://launchpad.net/bugs/1236257 (bzr r13034)
Diffstat (limited to 'src/ui/dialog/document-properties.cpp')
-rw-r--r--src/ui/dialog/document-properties.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp
index d324d2d1b..d344fb1d6 100644
--- a/src/ui/dialog/document-properties.cpp
+++ b/src/ui/dialog/document-properties.cpp
@@ -1703,9 +1703,14 @@ void DocumentProperties::onDocUnitChange()
repr->setAttribute("inkscape:document-units", os.str().c_str());
// Set viewBox
- Inkscape::Util::Quantity width = doc->getWidth();
- Inkscape::Util::Quantity height = doc->getHeight();
- doc->setViewBox(Geom::Rect::from_xywh(0, 0, width.value(doc_unit), height.value(doc_unit)));
+ if (doc->getRoot()->viewBox_set) {
+ gdouble scale = Inkscape::Util::Quantity::convert(1, old_doc_unit, doc_unit);
+ doc->setViewBox(doc->getRoot()->viewBox*Geom::Scale(scale));
+ } else {
+ Inkscape::Util::Quantity width = doc->getWidth();
+ Inkscape::Util::Quantity height = doc->getHeight();
+ doc->setViewBox(Geom::Rect::from_xywh(0, 0, width.value(doc_unit), height.value(doc_unit)));
+ }
// TODO: Fix bug in nodes tool instead of switching away from it
if (tools_active(getDesktop()) == TOOLS_NODES) {