r18743 by jghali - fix svg export issue with groups (see doc from #11884)

scribus-commit scribus-commit at lists.scribus.net
Sat Jan 18 14:52:22 UTC 2014


Author: jghali
Date: Sat Jan 18 14:52:22 2014
New Revision: 18743

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18743
Log:
fix svg export issue with groups (see doc from #11884)

Modified:
    trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp

Modified: trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18743&path=/trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp Sat Jan 18 14:52:22 2014
@@ -378,10 +378,26 @@
 					if (Item->fillTransparency() != 0)
 						ob.setAttribute("opacity", FToStr(1.0 - Item->fillTransparency()));
 				}
-				QString tr = trans + QString(" scale(%1, %2)").arg(Item->width() / Item->groupWidth).arg(Item->height() / Item->groupHeight);
+				QString tr = trans;
+				if (Item->imageFlippedH())
+				{
+					tr += QString(" translate(%1, 0.0)").arg(Item->width());
+					tr += QString(" scale(-1.0, 1.0)");
+				}
+				if (Item->imageFlippedV())
+				{
+					tr += QString(" translate(0.0, %1)").arg(Item->height());
+					tr += QString(" scale(1.0, -1.0)");
+				}
+				tr += QString(" scale(%1, %2)").arg(Item->width() / Item->groupWidth).arg(Item->height() / Item->groupHeight);
 				ob.setAttribute("transform", tr);
 				ob.setAttribute("style", "fill:none; stroke:none");
-				QDomElement obc = createClipPathElement(&Item->PoLine);
+				FPointArray clipPath = Item->PoLine;
+				QTransform transform;
+				transform.scale(Item->width() / Item->groupWidth, Item->height() / Item->groupHeight);
+				transform = transform.inverted();
+				clipPath.map(transform);
+				QDomElement obc = createClipPathElement(&clipPath);
 				if (!obc.isNull())
 					ob.setAttribute("clip-path", "url(#"+ obc.attribute("id") + ")");
 				if (Item->fillRule)




More information about the scribus-commit mailing list