summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/document-properties.cpp
diff options
context:
space:
mode:
authorDiederik van Lierop <mail@diedenrezi.nl>2014-08-26 20:38:14 +0000
committerDiederik van Lierop <mail@diedenrezi.nl>2014-08-26 20:38:14 +0000
commit7fd8ede6c698136bfa675dd4f1d5da6f5803154f (patch)
treeca7268c7a2bc3a6e68adfa95251a34bcadbae3c6 /src/ui/dialog/document-properties.cpp
parentTranslations. Czech translation update by Ivan Řihošek (31% translated). (diff)
downloadinkscape-7fd8ede6c698136bfa675dd4f1d5da6f5803154f.tar.gz
inkscape-7fd8ede6c698136bfa675dd4f1d5da6f5803154f.zip
Fix rotation center regression caused by my own commit 13512
Fixed bugs: - https://launchpad.net/bugs/1360953 - https://launchpad.net/bugs/1360946 (bzr r13534)
Diffstat (limited to 'src/ui/dialog/document-properties.cpp')
-rw-r--r--src/ui/dialog/document-properties.cpp10
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,