From 2df0abfd438d90edb6056f0197ed9d27ce2cd1f1 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Sun, 22 Sep 2013 13:47:37 -0400 Subject: 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) --- src/file.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/file.cpp') 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(); -- cgit v1.2.3