diff options
| author | su_v <suv-sf@users.sourceforge.net> | 2014-09-02 12:17:40 +0000 |
|---|---|---|
| committer | ~suv <suv-sf@users.sourceforge.net> | 2014-09-02 12:17:40 +0000 |
| commit | 78ff0bee3e358adf1051d4037c4043cc223d5afe (patch) | |
| tree | a23ed22cc7a5272585141a60afce42e2654458e1 /src/ui/dialog/document-properties.cpp | |
| parent | update to trunk (r13532) (diff) | |
| parent | configure.ac: Quell warnings about AM_PROG_AR when using automake 1.12 (diff) | |
| download | inkscape-78ff0bee3e358adf1051d4037c4043cc223d5afe.tar.gz inkscape-78ff0bee3e358adf1051d4037c4043cc223d5afe.zip | |
update to trunk (r13540)
(bzr r13398.1.9)
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 4e4616724..2757a0ec9 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, |
