From b590d0e6941257bf6205959dbe7a80f4d4f50080 Mon Sep 17 00:00:00 2001 From: Fridrich Štrba Date: Tue, 21 Jun 2011 16:50:34 +0200 Subject: Fix Ellipse shape + implement page scaling --- src/lib/VSD6Parser.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/lib/VSD6Parser.cpp') diff --git a/src/lib/VSD6Parser.cpp b/src/lib/VSD6Parser.cpp index 911f8d9..a2905fc 100644 --- a/src/lib/VSD6Parser.cpp +++ b/src/lib/VSD6Parser.cpp @@ -285,12 +285,12 @@ void libvisio::VSD6Parser::handlePage(VSDInternalStream &stream, libwpg::WPGPain binaryData.append(buffer, tmpBytesRead); WPXPropertyList foreignProps; - foreignProps.insert("svg:width", xform.width); - foreignProps.insert("svg:height", xform.height); - foreignProps.insert("svg:x", xform.pinX - xform.pinLocX); + foreignProps.insert("svg:width", m_scale*xform.width); + foreignProps.insert("svg:height", m_scale*xform.height); + foreignProps.insert("svg:x", m_scale*(xform.pinX - xform.pinLocX)); // Y axis starts at the bottom not top - foreignProps.insert("svg:y", pageProps["svg:height"]->getDouble() - - xform.pinY + xform.pinLocY - xform.height); + foreignProps.insert("svg:y", m_scale*(pageProps["svg:height"]->getDouble() + - xform.pinY + xform.pinLocY - xform.height)); if (foreignType == 1) { @@ -321,12 +321,12 @@ void libvisio::VSD6Parser::handlePage(VSDInternalStream &stream, libwpg::WPGPain { // Skip bytes representing unit to *display* (value is always inches) stream.seek(1, WPX_SEEK_CUR); - double width = readDouble(&stream); + m_pageWidth = readDouble(&stream); stream.seek(1, WPX_SEEK_CUR); - double height = readDouble(&stream); + m_pageHeight = readDouble(&stream); - pageProps.insert("svg:width", width); - pageProps.insert("svg:height", height); + pageProps.insert("svg:width", m_scale*m_pageWidth); + pageProps.insert("svg:height", m_scale*m_pageHeight); if (m_isPageStarted) painter->endGraphics(); painter->startGraphics(pageProps); -- cgit v1.2.3