From cddc1afecc0e701f4bae66d64435d3586ecf4bdb Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sun, 27 Oct 2013 17:25:28 +0100 Subject: fix crash, partly fix vertical positioning issue. couldn't figure out how to make it work, the applied scale transform works weird somehow Fixed bugs: - https://launchpad.net/bugs/1244793 (bzr r12732) --- src/extension/internal/emf-inout.cpp | 9 ++++----- src/extension/internal/wmf-inout.cpp | 9 ++++----- 2 files changed, 8 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/extension/internal/emf-inout.cpp b/src/extension/internal/emf-inout.cpp index 36d7ca145..67f90da91 100644 --- a/src/extension/internal/emf-inout.cpp +++ b/src/extension/internal/emf-inout.cpp @@ -3511,15 +3511,14 @@ Emf::open( Inkscape::Extension::Input * /*mod*/, const gchar *uri ) // Set viewBox doc->setViewBox(Geom::Rect::from_xywh(0, 0, doc->getWidth().value(doc_unit), doc->getHeight().value(doc_unit))); + doc->ensureUpToDate(); // Scale and translate objects - double scale = Inkscape::Util::Quantity::convert(1, "px", doc->getWidth().unit); + double scale = Inkscape::Util::Quantity::convert(1, "px", doc_unit); ShapeEditor::blockSetItem(true); - doc->getRoot()->scaleChildItemsRec(Geom::Scale(scale), Geom::Point(0, SP_ACTIVE_DOCUMENT->getHeight().value("px"))); + doc->getRoot()->scaleChildItemsRec(Geom::Scale(scale), Geom::Point(0, doc->getHeight().value("px"))); ShapeEditor::blockSetItem(false); - - doc->ensureUpToDate(); - + Inkscape::DocumentUndo::setUndoSensitive(doc, saved); } diff --git a/src/extension/internal/wmf-inout.cpp b/src/extension/internal/wmf-inout.cpp index 2c6fd9e52..e0e50cc03 100644 --- a/src/extension/internal/wmf-inout.cpp +++ b/src/extension/internal/wmf-inout.cpp @@ -3196,15 +3196,14 @@ Wmf::open( Inkscape::Extension::Input * /*mod*/, const gchar *uri ) // Set viewBox doc->setViewBox(Geom::Rect::from_xywh(0, 0, doc->getWidth().value(doc_unit), doc->getHeight().value(doc_unit))); - + doc->ensureUpToDate(); + // Scale and translate objects - double scale = Inkscape::Util::Quantity::convert(1, "px", doc->getWidth().unit); + double scale = Inkscape::Util::Quantity::convert(1, "px", doc_unit); ShapeEditor::blockSetItem(true); doc->getRoot()->scaleChildItemsRec(Geom::Scale(scale), Geom::Point(0, doc->getHeight().value("px"))); ShapeEditor::blockSetItem(false); - - doc->ensureUpToDate(); - + Inkscape::DocumentUndo::setUndoSensitive(doc, saved); } -- cgit v1.2.3