diff options
| author | Alvin Penner <penner@vaxxine.com> | 2016-02-12 14:52:13 +0000 |
|---|---|---|
| committer | apenner <penner@vaxxine.com> | 2016-02-12 14:52:13 +0000 |
| commit | 447b514a70131ba71e507c0ef4647b9101a57113 (patch) | |
| tree | 4589189fa70df9d7cfdf95f2696e94fe1e203069 /src/file.cpp | |
| parent | Fix default value of 'fr'. (diff) | |
| download | inkscape-447b514a70131ba71e507c0ef4647b9101a57113.tar.gz inkscape-447b514a70131ba71e507c0ef4647b9101a57113.zip | |
if viewbox does not exist, create it from page size, only if page size exists. (Bug 1544016)
Fixed bugs:
- https://launchpad.net/bugs/1544016
(bzr r14648)
Diffstat (limited to 'src/file.cpp')
| -rw-r--r-- | src/file.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/file.cpp b/src/file.cpp index 7ae7d238a..9d390908e 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -142,7 +142,9 @@ SPDesktop *sp_file_new(const std::string &templ) } // Set viewBox if it doesn't exist - if (!doc->getRoot()->viewBox_set) { + if (!doc->getRoot()->viewBox_set + && (doc->getRoot()->width.unit != SVGLength::PERCENT) + && (doc->getRoot()->height.unit != SVGLength::PERCENT)) { DocumentUndo::setUndoSensitive(doc, false); doc->setViewBox(Geom::Rect::from_xywh(0, 0, doc->getWidth().value(doc->getDisplayUnit()), doc->getHeight().value(doc->getDisplayUnit()))); DocumentUndo::setUndoSensitive(doc, true); @@ -289,7 +291,9 @@ bool sp_file_open(const Glib::ustring &uri, if (doc) { // Set viewBox if it doesn't exist - if (!doc->getRoot()->viewBox_set) { + if (!doc->getRoot()->viewBox_set + && (doc->getRoot()->width.unit != SVGLength::PERCENT) + && (doc->getRoot()->height.unit != SVGLength::PERCENT)) { DocumentUndo::setUndoSensitive(doc, false); doc->setViewBox(Geom::Rect::from_xywh(0, 0, doc->getWidth().value(doc->getDisplayUnit()), doc->getHeight().value(doc->getDisplayUnit()))); DocumentUndo::setUndoSensitive(doc, true); |
