summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/document-properties.cpp
diff options
context:
space:
mode:
authorsu_v <suv-sf@users.sourceforge.net>2014-08-20 03:16:23 +0000
committer~suv <suv-sf@users.sourceforge.net>2014-08-20 03:16:23 +0000
commit9225fd3f29be0822c556f4ca2a8a6ec3099377f9 (patch)
treefdb1a8ea2013aac3f8c0f73ff95d29e55bc13dc7 /src/ui/dialog/document-properties.cpp
parentmacosx packaging: a few minor changes (diff)
parentClear the waiting cursor on the old desktop after creating a new one (diff)
downloadinkscape-9225fd3f29be0822c556f4ca2a8a6ec3099377f9.tar.gz
inkscape-9225fd3f29be0822c556f4ca2a8a6ec3099377f9.zip
update to trunk (r13528)
(bzr r13506.1.18)
Diffstat (limited to 'src/ui/dialog/document-properties.cpp')
-rw-r--r--src/ui/dialog/document-properties.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp
index 9141b2268..4e4616724 100644
--- a/src/ui/dialog/document-properties.cpp
+++ b/src/ui/dialog/document-properties.cpp
@@ -45,6 +45,7 @@
#include "widgets/icon.h"
#include "xml/node-event-vector.h"
#include "xml/repr.h"
+#include <algorithm> // std::min
#include "rdf.h"
#include "ui/widget/entity-entry.h"
@@ -1735,9 +1736,9 @@ void DocumentProperties::onDocUnitChange()
prefs->setBool("/options/transform/gradient", true);
{
ShapeEditor::blockSetItem(true);
- gdouble viewscale = doc->getWidth().value("px")/doc->getRoot()->viewBox.width();
- if (doc->getHeight().value("px")/doc->getRoot()->viewBox.height() < viewscale)
- viewscale = doc->getHeight().value("px")/doc->getRoot()->viewBox.height();
+ 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 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,