summaryrefslogtreecommitdiffstats
path: root/src/file.cpp
diff options
context:
space:
mode:
authorMatthew Petroff <matthew@mpetroff.net>2013-09-22 17:47:37 +0000
committerMatthew Petroff <matthew@mpetroff.net>2013-09-22 17:47:37 +0000
commit2df0abfd438d90edb6056f0197ed9d27ce2cd1f1 (patch)
treead735614844c956d9799885b605dd3d866cd611f /src/file.cpp
parentFix CMake build (follow-up to r12567) (diff)
downloadinkscape-2df0abfd438d90edb6056f0197ed9d27ce2cd1f1.tar.gz
inkscape-2df0abfd438d90edb6056f0197ed9d27ce2cd1f1.zip
Fix adding viewBox to new documents.
Fixed bugs: - https://launchpad.net/bugs/1228660 - https://launchpad.net/bugs/1228693 - https://launchpad.net/bugs/1228852 (bzr r12575)
Diffstat (limited to 'src/file.cpp')
-rw-r--r--src/file.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/file.cpp b/src/file.cpp
index baa7b12b5..b19fe21ff 100644
--- a/src/file.cpp
+++ b/src/file.cpp
@@ -140,6 +140,11 @@ SPDesktop *sp_file_new(const std::string &templ)
DocumentUndo::clearUndo(doc);
}
+ // Set viewBox if it doesn't exist
+ if (!doc->getRoot()->viewBox_set) {
+ doc->setViewBox(Geom::Rect::from_xywh(0, 0, doc->getWidth().quantity, doc->getHeight().quantity));
+ }
+
SPDesktop *desktop = SP_ACTIVE_DESKTOP;
if (desktop)
desktop->setWaitingCursor();