r18779 by fschmid - Use new group clip attribute in the exporters

scribus-commit scribus-commit at lists.scribus.net
Mon Jan 27 20:47:10 UTC 2014


Author: fschmid
Date: Mon Jan 27 20:47:10 2014
New Revision: 18779

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18779
Log:
Use new group clip attribute in the exporters

Modified:
    trunk/Scribus/scribus/pdflib_core.cpp
    trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp
    trunk/Scribus/scribus/plugins/xpsexport/xpsexplugin.cpp
    trunk/Scribus/scribus/pslib.cpp

Modified: trunk/Scribus/scribus/pdflib_core.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18779&path=/trunk/Scribus/scribus/pdflib_core.cpp
==============================================================================
--- trunk/Scribus/scribus/pdflib_core.cpp (original)
+++ trunk/Scribus/scribus/pdflib_core.cpp Mon Jan 27 20:47:10 2014
@@ -2537,7 +2537,8 @@
 						{
 							QString tmpD = "";
 							PutPage("q\n");
-							PutPage(SetPathAndClip(ite));
+							if (ite->groupClipping())
+								PutPage(SetPathAndClip(ite));
 							if (ite->imageFlippedH())
 								PutPage("-1 0 0 1 "+FToStr(ite->width())+" 0 cm\n");
 							if (ite->imageFlippedV())
@@ -3350,7 +3351,8 @@
 				scaleH = controlItem->groupHeight / controlItem->height();
 			else
 				scaleH = 1.0 / (controlItem->groupHeight / controlItem->height());
-			PutDoc("/BBox [ "+FToStr(0)+" "+FToStr(-controlItem->height() * scaleH)+" "+FToStr(controlItem->groupWidth * scaleW)+" "+FToStr(controlItem->groupHeight * scaleH)+" ]\n");
+		//	PutDoc("/BBox [ "+FToStr(0)+" "+FToStr(-controlItem->height() * scaleH)+" "+FToStr(controlItem->groupWidth * scaleW)+" "+FToStr(controlItem->groupHeight * scaleH)+" ]\n");
+			PutDoc("/BBox [ "+FToStr(0)+" "+FToStr(-controlItem->height() * scaleH)+" "+FToStr(ActPageP->width())+" "+FToStr(controlItem->groupHeight * scaleH)+" ]\n");
 		}
 		if (controlItem->isSymbol())
 		{
@@ -4331,7 +4333,8 @@
 			{
 				QString tmpD = "";
 				tmp += "q\n";
-				tmp += SetPathAndClip(ite);
+				if (ite->groupClipping())
+					tmp += SetPathAndClip(ite);
 				if (ite->imageFlippedH())
 					tmp += "-1 0 0 1 "+FToStr(ite->width())+" 0 cm\n";
 				if (ite->imageFlippedV())

Modified: trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18779&path=/trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp Mon Jan 27 20:47:10 2014
@@ -392,18 +392,21 @@
 				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");
-				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)
-					ob.setAttribute("clip-rule", "evenodd");
-				else
-					ob.setAttribute("clip-rule", "nonzero");
+				if (Item->groupClipping())
+				{
+					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)
+						ob.setAttribute("clip-rule", "evenodd");
+					else
+						ob.setAttribute("clip-rule", "nonzero");
+				}
 				for (int em = 0; em < Item->groupItemList.count(); ++em)
 				{
 					PageItem* embed = Item->groupItemList.at(em);

Modified: trunk/Scribus/scribus/plugins/xpsexport/xpsexplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18779&path=/trunk/Scribus/scribus/plugins/xpsexport/xpsexplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/xpsexport/xpsexplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/xpsexport/xpsexplugin.cpp Mon Jan 27 20:47:10 2014
@@ -469,10 +469,13 @@
 						if (Item->fillTransparency() != 0)
 							ob.setAttribute("Opacity", FToStr(1.0 - Item->fillTransparency()));
 					}
-					FPointArray path = Item->PoLine.copy();
-					path.scale(conversionFactor, conversionFactor);
-					path.scale(Item->groupWidth / Item->width(), Item->groupHeight / Item->height());
-					SetClipAttr(ob, &path, Item->fillRule);
+					if (Item->groupClipping())
+					{
+						FPointArray path = Item->PoLine.copy();
+						path.scale(conversionFactor, conversionFactor);
+						path.scale(Item->groupWidth / Item->width(), Item->groupHeight / Item->height());
+						SetClipAttr(ob, &path, Item->fillRule);
+					}
 					QTransform mpx;
 					mpx.translate(xOffset * conversionFactor, yOffset * conversionFactor);
 					mpx.scale(Item->width() / Item->groupWidth, Item->height() / Item->groupHeight);

Modified: trunk/Scribus/scribus/pslib.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18779&path=/trunk/Scribus/scribus/pslib.cpp
==============================================================================
--- trunk/Scribus/scribus/pslib.cpp (original)
+++ trunk/Scribus/scribus/pslib.cpp Mon Jan 27 20:47:10 2014
@@ -2569,7 +2569,8 @@
 			break;
 		case PageItem::Group:
 			PS_save();
-			SetPathAndClip(c->PoLine, c->fillRule);
+			if (c->groupClipping())
+				SetPathAndClip(c->PoLine, c->fillRule);
 			if (c->imageFlippedH())
 			{
 				PS_translate(c->width(), 0);




More information about the scribus-commit mailing list