r14263 by fschmid - Xara Importer: fixed compound paths.

scribus-commit scribus-commit at lists.scribus.net
Thu Nov 5 18:35:20 CET 2009


Revision: 14263
Author: fschmid
Date: 2009-11-05T12:13:00.530112Z
Commit message: Xara Importer: fixed compound paths.

Changeset: 
M  /trunk/Scribus/scribus/plugins/xarimplugin/importxar.cpp

Diffs:
Index: scribus/plugins/xarimplugin/importxar.cpp
===================================================================
--- scribus/plugins/xarimplugin/importxar.cpp	(revision 14262)
+++ scribus/plugins/xarimplugin/importxar.cpp	(revision 14263)
@@ -443,12 +443,12 @@
 	if (tag == 0)
 	{
 		delete( m_gc.pop() );
-		qDebug() << "Stack dropped to" << m_gc.count();
+//		qDebug() << "Stack dropped to" << m_gc.count();
 	}
 	else if (tag == 1)
 	{
 		addGraphicContext();
-		qDebug() << "Stack pushed to" << m_gc.count();
+//		qDebug() << "Stack pushed to" << m_gc.count();
 	}
 	else if (tag == 10)
 		addToAtomic(dataLen, ts);
@@ -633,9 +633,10 @@
 	qint32 x, y;
 	quint8  verb, val;
 	double co1, co2, cx1, cy1, cx2, cy2, cx3, cy3;
-	FPoint currentPoint;
+	FPoint currentPoint, startPoint;
 	int bezCount = 0;
 	bool closed = false;
+	bool wasFirst = true;
 	Coords.resize(0);
 	Coords.svgInit();
 	for (uint a = 0; a < count; a++)
@@ -662,8 +663,18 @@
 		switch (verb)
 		{
 			case 6:
-				Coords.svgMoveTo(co1, docHeight - co2);
-				currentPoint = FPoint(co1, co2);
+				if (wasFirst)
+				{
+					Coords.svgMoveTo(co1, docHeight - co2);
+					currentPoint = FPoint(co1, co2);
+					wasFirst = false;
+				}
+				else
+				{
+					currentPoint = FPoint(currentPoint.x() - co1, currentPoint.y() - co2);
+					Coords.svgMoveTo(currentPoint.x(), docHeight - currentPoint.y());
+				}
+				startPoint = currentPoint;
 				break;
 			case 2:
 			case 3:
@@ -673,6 +684,7 @@
 				{
 					closed = true;
 					Coords.svgClosePath();
+					currentPoint = startPoint;
 				}
 				break;
 			case 4:
@@ -701,6 +713,7 @@
 					{
 						closed = true;
 						Coords.svgClosePath();
+						currentPoint = startPoint;
 					}
 					bezCount = 0;
 				}




More information about the scribus-commit mailing list