diff options
| author | Martin Owens <doctormo@gmail.com> | 2014-02-25 17:29:16 +0000 |
|---|---|---|
| committer | Martin Owens <doctormo@gmail.com> | 2014-02-25 17:29:16 +0000 |
| commit | e84ae2ae2b7035f2dd7ae0bfb026f80ff8bc8f87 (patch) | |
| tree | 7bfc20c5f22bb0120ebde7c81bc4410aca0dace4 /src/ui/dialog/document-properties.cpp | |
| parent | Not finished by improved data uri support (diff) | |
| parent | Fix infinite loop (?) by disabling saving the order of filters when they are ... (diff) | |
| download | inkscape-e84ae2ae2b7035f2dd7ae0bfb026f80ff8bc8f87.tar.gz inkscape-e84ae2ae2b7035f2dd7ae0bfb026f80ff8bc8f87.zip | |
Merge from trunk
(bzr r13047.1.3)
Diffstat (limited to 'src/ui/dialog/document-properties.cpp')
| -rw-r--r-- | src/ui/dialog/document-properties.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp index d344fb1d6..0411c789c 100644 --- a/src/ui/dialog/document-properties.cpp +++ b/src/ui/dialog/document-properties.cpp @@ -1734,8 +1734,14 @@ 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 scale = Inkscape::Util::Quantity::convert(1, old_doc_unit, doc_unit); - doc->getRoot()->scaleChildItemsRec(Geom::Scale(scale), Geom::Point(0, doc->getHeight().value("px"))); + 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, + viewscale*doc->getRoot()->viewBox.min()[Geom::Y] + + (doc->getHeight().value("px") + viewscale*doc->getRoot()->viewBox.height())/2)); ShapeEditor::blockSetItem(false); } prefs->setBool("/options/transform/stroke", transform_stroke); |
