diff options
| author | Liam P. White <inkscapebrony@gmail.com> | 2014-09-02 20:46:51 +0000 |
|---|---|---|
| committer | Liam P. White <inkscapebrony@gmail.com> | 2014-09-02 20:46:51 +0000 |
| commit | 7dc3de280a82ce03f1f4860bc1a523792b376f5d (patch) | |
| tree | b7e27f61b09b40dcabd9502d1009f346162bf6d4 /src/ui/dialog/document-properties.cpp | |
| parent | Header cleanup: stop using Glib types where they aren't truly needed. Eases G... (diff) | |
| parent | Fix locale issue in powerstroke width selection (diff) | |
| download | inkscape-7dc3de280a82ce03f1f4860bc1a523792b376f5d.tar.gz inkscape-7dc3de280a82ce03f1f4860bc1a523792b376f5d.zip | |
Update to trunk r13542
(bzr r13341.1.191)
Diffstat (limited to 'src/ui/dialog/document-properties.cpp')
| -rw-r--r-- | src/ui/dialog/document-properties.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp index 5ad82644e..2a3a1dd86 100644 --- a/src/ui/dialog/document-properties.cpp +++ b/src/ui/dialog/document-properties.cpp @@ -1736,9 +1736,13 @@ void DocumentProperties::onDocUnitChange() prefs->setBool("/options/transform/gradient", true); { ShapeEditor::blockSetItem(true); - gdouble viewscale_w = doc->getWidth().value("px")/doc->getRoot()->viewBox.width(); - gdouble viewscale_h = doc->getHeight().value("px")/doc->getRoot()->viewBox.height(); - gdouble viewscale = std::min(viewscale_h, viewscale_w); + gdouble viewscale = 1.0; + Geom::Rect vb = doc->getRoot()->viewBox; + if ( !vb.hasZeroArea() ) { + gdouble viewscale_w = doc->getWidth().value("px") / vb.width(); + gdouble viewscale_h = doc->getHeight().value("px")/ vb.height(); + viewscale = std::min(viewscale_h, viewscale_w); + } gdouble scale = Inkscape::Util::Quantity::convert(1, old_doc_unit, doc_unit); doc->getRoot()->scaleChildItemsRec(Geom::Scale(scale), Geom::Point(-viewscale*doc->getRoot()->viewBox.min()[Geom::X] + (doc->getWidth().value("px") - viewscale*doc->getRoot()->viewBox.width())/2, |
