summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFridrich Štrba <fridrich.strba@bluewin.ch>2012-01-12 12:14:15 +0100
committerFridrich Štrba <fridrich.strba@bluewin.ch>2012-01-12 12:14:15 +0100
commitdcfd213571043b04b03d5cb948457af258f0cdd1 (patch)
treefea9620bd249237634907c506a9dc4ecf1b0ad0a
parent1597ef913db6f3c4e16df727aeab988e6865ffcf (diff)
Initial implementation of foreign flips
-rw-r--r--src/lib/VSDXContentCollector.cpp40
1 files changed, 34 insertions, 6 deletions
diff --git a/src/lib/VSDXContentCollector.cpp b/src/lib/VSDXContentCollector.cpp
index fa1f16a..430d324 100644
--- a/src/lib/VSDXContentCollector.cpp
+++ b/src/lib/VSDXContentCollector.cpp
@@ -725,19 +725,47 @@ void libvisio::VSDXContentCollector::_flushText()
void libvisio::VSDXContentCollector::_flushCurrentForeignData()
{
- m_currentForeignProps.insert("svg:width", m_scale*m_foreignWidth);
- m_currentForeignProps.insert("svg:height", m_scale*m_foreignHeight);
double x = m_foreignOffsetX;
double y = m_foreignOffsetY;
transformPoint(x,y);
+ WPXPropertyList styleProps(m_styleProps);
- m_currentForeignProps.insert("svg:x", m_scale*x);
- // Y axis starts at the bottom not top
- m_currentForeignProps.insert("svg:y", m_scale*(y - m_foreignHeight));
+ if (m_xform.flipY)
+ {
+ m_currentForeignProps.insert("svg:width", -m_scale*m_foreignWidth);
+ m_currentForeignProps.insert("svg:height", -m_scale*m_foreignHeight);
+ m_currentForeignProps.insert("svg:y", m_scale*(y + m_foreignHeight));
+ if (m_xform.flipX)
+ {
+ m_currentForeignProps.insert("svg:x", m_scale*(x));
+ styleProps.insert("style:mirror", "horizontal");
+ }
+ else
+ {
+ m_currentForeignProps.insert("svg:x", m_scale*(x + m_foreignWidth));
+ styleProps.insert("style:mirror", "none");
+ }
+ }
+ else
+ {
+ m_currentForeignProps.insert("svg:width", m_scale*m_foreignWidth);
+ m_currentForeignProps.insert("svg:height", m_scale*m_foreignHeight);
+ m_currentForeignProps.insert("svg:y", m_scale*(y - m_foreignHeight));
+ if (m_xform.flipX)
+ {
+ m_currentForeignProps.insert("svg:x", m_scale*(x - m_foreignWidth));
+ styleProps.insert("style:mirror", "none");
+ }
+ else
+ {
+ m_currentForeignProps.insert("svg:x", m_scale*(x));
+ styleProps.insert("style:mirror", "horizontal");
+ }
+ }
if (m_currentForeignData.size() && m_currentForeignProps["libwpg:mime-type"] && !m_noShow)
{
- m_shapeOutputDrawing->addStyle(m_styleProps, WPXPropertyListVector());
+ m_shapeOutputDrawing->addStyle(styleProps, WPXPropertyListVector());
m_shapeOutputDrawing->addGraphicObject(m_currentForeignProps, m_currentForeignData);
}
m_currentForeignData.clear();