r16311 by fschmid - Initial committ of the new "Spiral" tool.

scribus-commit scribus-commit at lists.scribus.net
Thu Jan 27 19:21:42 CET 2011


Author: fschmid
Date: Thu Jan 27 18:21:41 2011
New Revision: 16311

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=16311
Log:
Initial committ of the new "Spiral" tool.

Added:
    trunk/Scribus/resources/icons/16/draw-spiral.png   (with props)
    trunk/Scribus/resources/icons/22/draw-spiral.png   (with props)
    trunk/Scribus/scribus/canvasmode_editspiral.cpp
    trunk/Scribus/scribus/canvasmode_editspiral.h
    trunk/Scribus/scribus/pageitem_spiral.cpp
    trunk/Scribus/scribus/pageitem_spiral.h
    trunk/Scribus/scribus/ui/spiralvectorbase.ui
    trunk/Scribus/scribus/ui/spiralvectordialog.cpp
    trunk/Scribus/scribus/ui/spiralvectordialog.h
Modified:
    trunk/Scribus/scribus/CMakeLists.txt
    trunk/Scribus/scribus/actionmanager.cpp
    trunk/Scribus/scribus/canvas.h
    trunk/Scribus/scribus/canvasgesture_resize.cpp
    trunk/Scribus/scribus/canvasmode.cpp
    trunk/Scribus/scribus/canvasmode_create.cpp
    trunk/Scribus/scribus/canvasmode_normal.cpp
    trunk/Scribus/scribus/pageitem.cpp
    trunk/Scribus/scribus/pageitem.h
    trunk/Scribus/scribus/pageitem_arc.cpp
    trunk/Scribus/scribus/pdflib_core.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
    trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp
    trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortion.cpp
    trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortiondialog.cpp
    trunk/Scribus/scribus/plugins/tools/2geomtools/pathalongpath/pathalongpath.cpp
    trunk/Scribus/scribus/plugins/tools/lenseffects/lensdialog.cpp
    trunk/Scribus/scribus/plugins/tools/lenseffects/lenseffects.cpp
    trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnect.cpp
    trunk/Scribus/scribus/plugins/tools/pathcut/pathcut.cpp
    trunk/Scribus/scribus/plugins/tools/pathfinder/pathfinder.cpp
    trunk/Scribus/scribus/plugins/tools/pathstroker/pathstroker.cpp
    trunk/Scribus/scribus/prefsmanager.cpp
    trunk/Scribus/scribus/prefsstructs.h
    trunk/Scribus/scribus/pslib.cpp
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/scribusdoc.cpp
    trunk/Scribus/scribus/scribusstructs.h
    trunk/Scribus/scribus/scribusview.h
    trunk/Scribus/scribus/ui/about.cpp
    trunk/Scribus/scribus/ui/arcvectordialog.h
    trunk/Scribus/scribus/ui/modetoolbar.cpp
    trunk/Scribus/scribus/ui/outlinepalette.cpp
    trunk/Scribus/scribus/ui/propertiespalette.cpp
    trunk/Scribus/scribus/util_math.cpp
    trunk/Scribus/scribus/util_math.h

Modified: trunk/Scribus/scribus/CMakeLists.txt
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16311&path=/trunk/Scribus/scribus/CMakeLists.txt
==============================================================================
--- trunk/Scribus/scribus/CMakeLists.txt (original)
+++ trunk/Scribus/scribus/CMakeLists.txt Thu Jan 27 18:21:41 2011
@@ -128,6 +128,7 @@
   ui/smpstylewidget.ui
   ui/smreplacedia.ui
   ui/smstyleimport.ui
+  ui/spiralvectorbase.ui
   ui/stylemanager.ui
   ui/transformdialogbase.ui
   ui/transparencypalette.ui
@@ -149,6 +150,7 @@
   canvasmode_edit.h
   canvasmode_editarc.h
   canvasmode_editpolygon.h
+  canvasmode_editspiral.h
   canvasmode_measurements.h
   canvasmode_normal.h
   chartablemodel.h
@@ -181,6 +183,7 @@
   pageitem_polygon.h
   pageitem_polyline.h
   pageitem_regularpolygon.h
+  pageitem_spiral.h
   pageitem_symbol.h
   pageitem_textframe.h
   pageitempointer.h
@@ -371,6 +374,7 @@
   ui/smtabruler.h
   ui/smtextstyles.h
   ui/spalette.h
+  ui/spiralvectordialog.h
   ui/storyeditor.h
   ui/stylemanager.h
   ui/styleselect.h
@@ -417,6 +421,7 @@
   canvasmode_editgradient.cpp
   canvasmode_editmeshgradient.cpp
   canvasmode_editpolygon.cpp
+  canvasmode_editspiral.cpp
   canvasmode_magnifier.cpp
   canvasmode_measurements.cpp
   canvasmode_nodeedit.cpp
@@ -485,6 +490,7 @@
   pageitem_polygon.cpp
   pageitem_polyline.cpp
   pageitem_regularpolygon.cpp
+  pageitem_spiral.cpp
   pageitem_symbol.cpp
   pageitem_textframe.cpp
   pageitempointer.cpp
@@ -752,6 +758,7 @@
   ui/smtabruler.cpp
   ui/smtextstyles.cpp
   ui/spalette.cpp
+  ui/spiralvectordialog.cpp
   ui/splash.cpp
   ui/storyeditor.cpp
   ui/stylemanager.cpp

Modified: trunk/Scribus/scribus/actionmanager.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16311&path=/trunk/Scribus/scribus/actionmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/actionmanager.cpp (original)
+++ trunk/Scribus/scribus/actionmanager.cpp Thu Jan 27 18:21:41 2011
@@ -708,6 +708,8 @@
 	scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/draw-polygon.png"), loadIcon("22/draw-polygon.png"), "", defaultKey(name), mainWindow, modeDrawRegularPolygon));
 	name="toolsInsertArc";
 	scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/draw-arc.png"), loadIcon("22/draw-arc.png"), "", defaultKey(name), mainWindow, modeDrawArc));
+	name="toolsInsertSpiral";
+	scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/draw-spiral.png"), loadIcon("22/draw-spiral.png"), "", defaultKey(name), mainWindow, modeDrawSpiral));
 	name="toolsInsertLine";
 	scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("Stift16.xpm"), loadIcon("Stift.xpm"), "", defaultKey(name), mainWindow, modeDrawLine));
 	name="toolsInsertBezier";
@@ -783,7 +785,7 @@
 	(*scrActions)["toolsToolbarPDF"]->setToggleAction(true);
 
 	*modeActionNames << "toolsSelect" << "toolsInsertTextFrame" << "toolsInsertImageFrame" << "toolsInsertTableFrame";
-	*modeActionNames << "toolsInsertShape" << "toolsInsertPolygon" << "toolsInsertArc" << "toolsInsertLine" << "toolsInsertBezier";
+	*modeActionNames << "toolsInsertShape" << "toolsInsertPolygon" << "toolsInsertArc" << "toolsInsertSpiral" << "toolsInsertLine" << "toolsInsertBezier";
 	*modeActionNames << "toolsInsertFreehandLine" << "toolsInsertCalligraphicLine" << "toolsInsertRenderFrame" << "toolsRotate" << "toolsZoom" << "toolsEditContents";
 	*modeActionNames << "toolsEditWithStoryEditor" << "toolsLinkTextFrame" << "toolsUnlinkTextFrame";
 	*modeActionNames << "toolsEyeDropper" << "toolsCopyProperties";
@@ -1475,6 +1477,7 @@
 	(*scrActions)["toolsInsertShape"]->setText( tr("Insert &Shape"));
 	(*scrActions)["toolsInsertPolygon"]->setText( tr("Insert &Polygon"));
 	(*scrActions)["toolsInsertArc"]->setText( tr("Insert Arc"));
+	(*scrActions)["toolsInsertSpiral"]->setText( tr("Insert Spiral"));
 	(*scrActions)["toolsInsertLine"]->setText( tr("Insert &Line"));
 	(*scrActions)["toolsInsertCalligraphicLine"]->setText( tr("Insert Calligraphic Line"));
 	(*scrActions)["toolsInsertBezier"]->setText( tr("Insert &Bezier Curve"));
@@ -1866,6 +1869,7 @@
 		<< "toolsInsertShape"
 		<< "toolsInsertPolygon"
 		<< "toolsInsertArc"
+		<< "toolsInsertSpiral"
 		<< "toolsInsertLine"
 		<< "toolsInsertBezier"
 		<< "toolsInsertFreehandLine"

Modified: trunk/Scribus/scribus/canvas.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16311&path=/trunk/Scribus/scribus/canvas.h
==============================================================================
--- trunk/Scribus/scribus/canvas.h (original)
+++ trunk/Scribus/scribus/canvas.h Thu Jan 27 18:21:41 2011
@@ -94,6 +94,7 @@
 	friend class CanvasMode_EditGradient;
 	friend class CanvasMode_EditMeshGradient;
 	friend class CanvasMode_EditPolygon;
+	friend class CanvasMode_EditSpiral;
 	friend class CanvasMode_EyeDropper;
 	friend class CanvasMode_FrameLinks;
 	friend class CanvasMode_Magnifier;

Modified: trunk/Scribus/scribus/canvasgesture_resize.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16311&path=/trunk/Scribus/scribus/canvasgesture_resize.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasgesture_resize.cpp (original)
+++ trunk/Scribus/scribus/canvasgesture_resize.cpp Thu Jan 27 18:21:41 2011
@@ -30,6 +30,7 @@
 #include "selection.h"
 #include "undomanager.h"
 #include "pageitem_arc.h"
+#include "pageitem_spiral.h"
 #include "util_math.h"
 
 ResizeGesture::ResizeGesture (CanvasMode* parent) : CanvasGesture(parent)
@@ -209,6 +210,14 @@
 			dsch = item->arcHeight / currItem->height();
 		if (currItem->width() != 0.0)
 			dscw = item->arcWidth / currItem->width();
+	}
+	if (currItem->isSpiral())
+	{
+		PageItem_Spiral* item = currItem->asSpiral();
+		if (currItem->height() != 0.0)
+			dsch = item->spiralHeight / currItem->height();
+		if (currItem->width() != 0.0)
+			dscw = item->spiralWidth / currItem->width();
 	}
 	if (m_doc->m_Selection->isMultipleSelection())
 	{
@@ -318,6 +327,13 @@
 			currItem->PoLine.translate(-tp2.x(), -tp2.y());
 			m_doc->AdjustItemSize(currItem);
 		}
+		if (currItem->isSpiral())
+		{
+			PageItem_Spiral* item = currItem->asSpiral();
+			item->spiralWidth += dw * dscw;
+			item->spiralHeight += dh * dsch;
+			item->recalcPath();
+		}
 		// rotation does not change
 	}
 	m_origBounds = m_bounds;

Modified: trunk/Scribus/scribus/canvasmode.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16311&path=/trunk/Scribus/scribus/canvasmode.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode.cpp (original)
+++ trunk/Scribus/scribus/canvasmode.cpp Thu Jan 27 18:21:41 2011
@@ -28,6 +28,7 @@
 #include "canvasmode_editgradient.h"
 #include "canvasmode_editmeshgradient.h"
 #include "canvasmode_editpolygon.h"
+#include "canvasmode_editspiral.h"
 #include "canvasmode_eyedropper.h"
 #include "canvasmode_framelinks.h"
 #include "canvasmode_magnifier.h"
@@ -137,6 +138,7 @@
 		case modeDrawTable:
 		case modeDrawRegularPolygon:
 		case modeDrawArc:
+		case modeDrawSpiral:
 		case modeInsertPDFButton:
 		case modeInsertPDFTextfield:
 		case modeInsertPDFCheckbox:
@@ -174,6 +176,9 @@
 			break;
 		case modeEditPolygon:
 			result = new CanvasMode_EditPolygon(view);
+			break;
+		case modeEditSpiral:
+			result = new CanvasMode_EditSpiral(view);
 			break;
 			// more modes as they are defined...
 			
@@ -549,6 +554,7 @@
 	{
 		case modeDrawShapes:
 		case modeDrawArc:
+		case modeDrawSpiral:
 			qApp->changeOverrideCursor(QCursor(loadIcon("DrawFrame.xpm")));
 			break;
 		case modeDrawImage:
@@ -602,6 +608,7 @@
 		case modeInsertPDF3DAnnotation:
 		case modeEditArc:
 		case modeEditPolygon:
+		case modeEditSpiral:
 			qApp->changeOverrideCursor(QCursor(Qt::CrossCursor));
 			break;
 		default:

Modified: trunk/Scribus/scribus/canvasmode_create.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16311&path=/trunk/Scribus/scribus/canvasmode_create.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_create.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_create.cpp Thu Jan 27 18:21:41 2011
@@ -117,6 +117,12 @@
 			p->translate(localRect.left(), localRect.top());
 			p->drawPath(path);
 		}
+		else if (createObjectMode == modeDrawSpiral)
+		{
+			QPainterPath path = SpiralPath(localRect.width(), localRect.height(), m_doc->itemToolPrefs().spiralStartAngle, m_doc->itemToolPrefs().spiralEndAngle, m_doc->itemToolPrefs().spiralFactor);
+			p->translate(localRect.left(), localRect.top());
+			p->drawPath(path);
+		}
 		else if ((createObjectMode == modeDrawShapes) && (createObjectSubMode > 1))
 		{
 			FPointArray poly;
@@ -527,6 +533,10 @@
 		break;
 	case modeDrawArc:
 		itemType  = (int) PageItem::Arc;
+		frameType = (int) PageItem::Unspecified;
+		break;
+	case modeDrawSpiral:
+		itemType  = (int) PageItem::Spiral;
 		frameType = (int) PageItem::Unspecified;
 		break;
 	case modeInsertPDFButton:
@@ -664,6 +674,14 @@
 			z = m_doc->itemAddArea(PageItem::Arc, PageItem::Unspecified, Rxp, Ryp, m_doc->itemToolPrefs().shapeLineWidth, m_doc->itemToolPrefs().shapeFillColor, m_doc->itemToolPrefs().lineColor, true);
 		else
 			z = m_doc->itemAdd(PageItem::Arc, PageItem::Unspecified, Rxp, Ryp, Rxpd, Rypd, m_doc->itemToolPrefs().shapeLineWidth, m_doc->itemToolPrefs().shapeFillColor, m_doc->itemToolPrefs().lineColor, true);
+		m_doc->AdjustItemSize(m_doc->Items->at(z));
+		m_doc->setRedrawBounding(m_doc->Items->at(z));
+		break;
+	case modeDrawSpiral:
+		if (modifiers == Qt::ShiftModifier)
+			z = m_doc->itemAddArea(PageItem::Spiral, PageItem::Unspecified, Rxp, Ryp, m_doc->itemToolPrefs().shapeLineWidth, CommonStrings::None, m_doc->itemToolPrefs().lineColor, true);
+		else
+			z = m_doc->itemAdd(PageItem::Spiral, PageItem::Unspecified, Rxp, Ryp, Rxpd, Rypd, m_doc->itemToolPrefs().shapeLineWidth, CommonStrings::None, m_doc->itemToolPrefs().lineColor, true);
 		m_doc->AdjustItemSize(m_doc->Items->at(z));
 		m_doc->setRedrawBounding(m_doc->Items->at(z));
 		break;

Modified: trunk/Scribus/scribus/canvasmode_normal.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16311&path=/trunk/Scribus/scribus/canvasmode_normal.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_normal.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_normal.cpp Thu Jan 27 18:21:41 2011
@@ -241,18 +241,6 @@
 			if (!m_doc->symbolEditMode())
 				m_view->requestMode(submodeEditSymbol);
 		}
-	/*	else if (currItem->asRegularPolygon())
-		{
-			PageItem_RegularPolygon* item = currItem->asRegularPolygon();
-			PolygonProps* dia = new PolygonProps(m_ScMW, item->polyCorners, item->polyFactor, item->polyUseFactor, item->polyRotation, item->polyCurvature, item->polyInnerRot, item->polyOuterCurvature);
-			if (dia->exec())
-			{
-				dia->getValues(&item->polyCorners, &item->polyFactor, &item->polyUseFactor, &item->polyRotation, &item->polyCurvature, &item->polyInnerRot, &item->polyOuterCurvature);
-				item->recalcPath();
-			}
-			delete dia;
-			m_view->updateContents();
-		} */
 		else if (currItem->asArc())
 		{
 			m_view->requestMode(modeEditArc);
@@ -260,6 +248,10 @@
 		else if (currItem->asRegularPolygon())
 		{
 			m_view->requestMode(modeEditPolygon);
+		}
+		else if (currItem->asSpiral())
+		{
+			m_view->requestMode(modeEditSpiral);
 		}
 	}
 }

Modified: trunk/Scribus/scribus/pageitem.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16311&path=/trunk/Scribus/scribus/pageitem.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem.cpp (original)
+++ trunk/Scribus/scribus/pageitem.cpp Thu Jan 27 18:21:41 2011
@@ -563,6 +563,10 @@
 		AnName = tr("Arc");
 		setUPixmap(Um::IPolygon);
 		break;
+	case Spiral:
+		AnName = tr("Spiral");
+		setUPixmap(Um::IPolygon);
+		break;
 	default:
 		AnName = "Item";
 		break;
@@ -1554,7 +1558,7 @@
 			p->setBlendModeFill(0);
 	#endif
 			p->setMaskMode(0);
-			if (itemType()==PathText || itemType()==PolyLine || itemType()==Line || itemType()==Symbol || itemType()==Group)
+			if (itemType()==PathText || itemType()==PolyLine || itemType()==Spiral || itemType()==Line || itemType()==Symbol || itemType()==Group)
 				doStroke=false;
 			if ((doStroke) && (!m_Doc->RePos))
 			{
@@ -1810,6 +1814,7 @@
 				break;
 			case Line:
 			case PolyLine:
+			case Spiral:
 				embedded->m_lineWidth = pws * qMin(style.scaleH() / 1000.0, style.scaleV() / 1000.0);
 				embedded->DrawObj_Item(p, cullingArea);
 				break;
@@ -2562,6 +2567,7 @@
 				case Polygon:
 				case RegularPolygon:
 				case Arc:
+				case Spiral:
 					GrColorP1 = m_Doc->itemToolPrefs().shapeFillColor;
 					break;
 				default:
@@ -2599,6 +2605,7 @@
 				case Polygon:
 				case RegularPolygon:
 				case Arc:
+				case Spiral:
 					GrColorP2 = m_Doc->itemToolPrefs().shapeFillColor;
 					break;
 				default:
@@ -2636,6 +2643,7 @@
 				case Polygon:
 				case RegularPolygon:
 				case Arc:
+				case Spiral:
 					GrColorP3 = m_Doc->itemToolPrefs().shapeFillColor;
 					break;
 				default:
@@ -2673,6 +2681,7 @@
 				case Polygon:
 				case RegularPolygon:
 				case Arc:
+				case Spiral:
 					GrColorP4 = m_Doc->itemToolPrefs().shapeFillColor;
 					break;
 				default:
@@ -2739,6 +2748,7 @@
 				case Polygon:
 				case RegularPolygon:
 				case Arc:
+				case Spiral:
 					MColor = m_Doc->itemToolPrefs().shapeFillColor;
 					break;
 				default:
@@ -2788,6 +2798,7 @@
 				case Polygon:
 				case RegularPolygon:
 				case Arc:
+				case Spiral:
 					MColor = m_Doc->itemToolPrefs().shapeFillColor;
 					break;
 				default:
@@ -3089,6 +3100,7 @@
 				case Polygon:
 				case RegularPolygon:
 				case Arc:
+				case Spiral:
 					tmp = m_Doc->itemToolPrefs().shapeFillColor;
 					break;
 				default:
@@ -3184,6 +3196,7 @@
 				case OSGFrame:
 				case RegularPolygon:
 				case Arc:
+				case Spiral:
 					tmp = m_Doc->itemToolPrefs().shapeLineColor;
 					break;
 				default:
@@ -3307,6 +3320,7 @@
 				case OSGFrame:
 				case RegularPolygon:
 				case Arc:
+				case Spiral:
 					lineColorVal = m_Doc->itemToolPrefs().shapeLineColor;
 					break;
 				default:
@@ -3346,6 +3360,7 @@
 				case Polygon:
 				case RegularPolygon:
 				case Arc:
+				case Spiral:
 					fillColorVal = m_Doc->itemToolPrefs().shapeFillColor;
 					break;
 				default:

Modified: trunk/Scribus/scribus/pageitem.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16311&path=/trunk/Scribus/scribus/pageitem.h
==============================================================================
--- trunk/Scribus/scribus/pageitem.h (original)
+++ trunk/Scribus/scribus/pageitem.h Thu Jan 27 18:21:41 2011
@@ -73,6 +73,7 @@
 class PageItem_Symbol;
 class PageItem_Group;
 class PageItem_Arc;
+class PageItem_Spiral;
 #ifdef HAVE_OSG
 class PageItem_OSGFrame;
 #endif
@@ -172,6 +173,7 @@
 		Group			= 12,
 		RegularPolygon	= 13,
 		Arc				= 14,
+		Spiral			= 15,
 		Multiple		= 99
 	};
 
@@ -202,6 +204,7 @@
 	virtual PageItem_Group * asGroupFrame() { return NULL; }
 	virtual PageItem_RegularPolygon * asRegularPolygon() { return NULL; }
 	virtual PageItem_Arc * asArc() { return NULL; }
+	virtual PageItem_Spiral * asSpiral() { return NULL; }
 
 	virtual bool isImageFrame()		const { return false; }
 	virtual bool isLine()			const { return false; }
@@ -215,6 +218,7 @@
 	virtual bool isGroup()			const { return false; }
 	virtual bool isRegularPolygon()	const { return false; }
 	virtual bool isArc()			const { return false; }
+	virtual bool isSpiral()			const { return false; }
 
 	/** @brief Frame Type
 	 *

Modified: trunk/Scribus/scribus/pageitem_arc.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16311&path=/trunk/Scribus/scribus/pageitem_arc.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_arc.cpp (original)
+++ trunk/Scribus/scribus/pageitem_arc.cpp Thu Jan 27 18:21:41 2011
@@ -54,12 +54,7 @@
 	arcWidth = w;
 	arcStartAngle = m_Doc->itemToolPrefs().arcStartAngle;
 	arcSweepAngle = m_Doc->itemToolPrefs().arcSweepAngle;
-	QPainterPath path;
-	path.moveTo(w / 2.0, h / 2.0);
-	path.arcTo(0.0, 0.0, w, h, arcStartAngle, arcSweepAngle);
-	path.closeSubpath();
-	PoLine.fromQPainterPath(path);
-	Clip = FlattenPath(PoLine, Segments);
+	recalcPath();
 }
 
 void PageItem_Arc::DrawObj_Item(ScPainter *p, QRectF /*e*/)

Modified: trunk/Scribus/scribus/pdflib_core.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16311&path=/trunk/Scribus/scribus/pdflib_core.cpp
==============================================================================
--- trunk/Scribus/scribus/pdflib_core.cpp (original)
+++ trunk/Scribus/scribus/pdflib_core.cpp Thu Jan 27 18:21:41 2011
@@ -2281,6 +2281,7 @@
 						}
 						break;
 					case PageItem::PolyLine:
+					case PageItem::Spiral:
 						if (ite->PoLine.size() > 4) // && ((ite->PoLine.point(0) != ite->PoLine.point(1)) || (ite->PoLine.point(2) != ite->PoLine.point(3))))
 						{
 							PutPage("q\n");
@@ -4051,6 +4052,7 @@
 			}
 			break;
 		case PageItem::PolyLine:
+		case PageItem::Spiral:
 			if (ite->PoLine.size() > 4)  // && ((ite->PoLine.point(0) != ite->PoLine.point(1)) || (ite->PoLine.point(2) != ite->PoLine.point(3))))
 			{
 				tmp += "q\n";

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16311&path=/trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp Thu Jan 27 18:21:41 2011
@@ -371,6 +371,7 @@
 	case PageItem::Multiple:
 	case PageItem::RegularPolygon:
 	case PageItem::Arc:
+	case PageItem::Spiral:
 		Q_ASSERT(false);
 		break;
 	case PageItem::LatexFrame:

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16311&path=/trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp Thu Jan 27 18:21:41 2011
@@ -2540,6 +2540,7 @@
 	case PageItem::Symbol:
 	case PageItem::RegularPolygon:
 	case PageItem::Arc:
+	case PageItem::Spiral:
 	case PageItem::Multiple:
 		Q_ASSERT(false);
 		break;

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16311&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp Thu Jan 27 18:21:41 2011
@@ -33,6 +33,7 @@
 #endif
 #include "pageitem_regularpolygon.h"
 #include "pageitem_arc.h"
+#include "pageitem_spiral.h"
 #include <QCursor>
 // #include <QDebug>
 #include <QFileInfo>
@@ -1716,6 +1717,9 @@
 
 	doc->itemToolPrefs().arcStartAngle = attrs.valueAsDouble("arcStartAngle", 30.0);
 	doc->itemToolPrefs().arcSweepAngle = attrs.valueAsDouble("arcSweepAngle", 300.0);
+	doc->itemToolPrefs().spiralStartAngle = attrs.valueAsDouble("spiralStartAngle", 0.0);
+	doc->itemToolPrefs().spiralEndAngle = attrs.valueAsDouble("spiralEndAngle", 1080.0);
+	doc->itemToolPrefs().spiralFactor = attrs.valueAsDouble("spiralFactor", 1.2);
 
 	doc->itemToolPrefs().lineStartArrow = attrs.valueAsInt("StartArrow", 0);
 	doc->itemToolPrefs().lineEndArrow   = attrs.valueAsInt("EndArrow", 0);
@@ -3372,6 +3376,12 @@
 		if (pagenr > -2) 
 			currItem->OwnPage = pagenr;
 		break;
+	case PageItem::Spiral:
+		z = doc->itemAdd(PageItem::Spiral, PageItem::Unspecified, x, y, w, h, pw, Pcolor, Pcolor2, true);
+		currItem = doc->Items->at(z);
+		if (pagenr > -2) 
+			currItem->OwnPage = pagenr;
+		break;
 	case PageItem::Multiple:
 		Q_ASSERT(false);
 		break;
@@ -3705,6 +3715,15 @@
 		arcitem->arcStartAngle = attrs.valueAsDouble("arcStartAngle", 30.0);
 		arcitem->arcSweepAngle = attrs.valueAsDouble("arcSweepAngle", 300.0);
 	}
+	if (currItem->asSpiral())
+	{
+		PageItem_Spiral *arcitem = currItem->asSpiral();
+		arcitem->spiralHeight     = attrs.valueAsDouble("spiralHeight", 1.0);
+		arcitem->spiralWidth      = attrs.valueAsDouble("spiralWidth", 1.0);
+		arcitem->spiralStartAngle = attrs.valueAsDouble("spiralStartAngle", 0.0);
+		arcitem->spiralEndAngle = attrs.valueAsDouble("spiralEndAngle", 360.0);
+		arcitem->spiralFactor = attrs.valueAsDouble("spiralFactor", 1.2);
+	}
 	currItem->GrType = attrs.valueAsInt("GRTYP", 0);
 	QString GrColor;
 	QString GrColor2;

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16311&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp Thu Jan 27 18:21:41 2011
@@ -26,6 +26,7 @@
 #endif
 #include "pageitem_regularpolygon.h"
 #include "pageitem_arc.h"
+#include "pageitem_spiral.h"
 
 #include "units.h"
 #include "util.h"
@@ -263,7 +264,10 @@
 	docu.writeAttribute("POLYOCUR", m_Doc->itemToolPrefs().polyOuterCurvature);
 	docu.writeAttribute("POLYS", static_cast<int>(m_Doc->itemToolPrefs().polyUseFactor));
 	docu.writeAttribute("arcStartAngle", m_Doc->itemToolPrefs().arcStartAngle);
-	docu.writeAttribute("arcSweepAngle", m_Doc->itemToolPrefs().polyInnerRot);
+	docu.writeAttribute("arcSweepAngle", m_Doc->itemToolPrefs().arcSweepAngle);
+	docu.writeAttribute("spiralStartAngle", m_Doc->itemToolPrefs().spiralStartAngle);
+	docu.writeAttribute("spiralEndAngle", m_Doc->itemToolPrefs().spiralEndAngle);
+	docu.writeAttribute("spiralFactor", m_Doc->itemToolPrefs().spiralFactor);
 	docu.writeAttribute("AutoSave", static_cast<int>(m_Doc->autoSave()));
 	docu.writeAttribute("AutoSaveTime", m_Doc->autoSaveTime());
 	docu.writeAttribute("ScratchBottom", m_Doc->scratch()->Bottom);
@@ -1714,6 +1718,15 @@
 		docu.writeAttribute("arcWidth", arcitem->arcWidth);
 		docu.writeAttribute("arcStartAngle", arcitem->arcStartAngle);
 		docu.writeAttribute("arcSweepAngle", arcitem->arcSweepAngle);
+	}
+	if (item->asSpiral())
+	{
+		PageItem_Spiral *arcitem = item->asSpiral();
+		docu.writeAttribute("spiralHeight", arcitem->spiralHeight);
+		docu.writeAttribute("spiralWidth", arcitem->spiralWidth);
+		docu.writeAttribute("spiralStartAngle", arcitem->spiralStartAngle);
+		docu.writeAttribute("spiralEndAngle", arcitem->spiralEndAngle);
+		docu.writeAttribute("spiralFactor", arcitem->spiralFactor);
 	}
 	if(item->isAnnotation())
 	{

Modified: trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16311&path=/trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp Thu Jan 27 18:21:41 2011
@@ -383,6 +383,7 @@
 		case PageItem::Polygon:
 		case PageItem::PolyLine:
 		case PageItem::RegularPolygon:
+		case PageItem::Spiral:
 			ob = processPolyItem(Item, trans, fill, stroke);
 			if ((Item->lineColor() != CommonStrings::None) && ((Item->startArrowIndex() != 0) || (Item->endArrowIndex() != 0)))
 				ob = processArrows(Item, ob, trans);
@@ -1205,6 +1206,7 @@
 			case PageItem::Polygon:
 			case PageItem::PolyLine:
 			case PageItem::RegularPolygon:
+			case PageItem::Spiral:
 				obE = processPolyItem(embedded, trans, fill, stroke);
 				if ((embedded->lineColor() != CommonStrings::None) && ((embedded->startArrowIndex() != 0) || (embedded->endArrowIndex() != 0)))
 					obE = processArrows(embedded, obE, trans);

Modified: trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortion.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16311&path=/trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortion.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortion.cpp (original)
+++ trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortion.cpp Thu Jan 27 18:21:41 2011
@@ -81,6 +81,7 @@
 	m_actionInfo.notSuitableFor.append(PageItem::Symbol);
 	m_actionInfo.notSuitableFor.append(PageItem::RegularPolygon);
 	m_actionInfo.notSuitableFor.append(PageItem::Arc);
+	m_actionInfo.notSuitableFor.append(PageItem::Spiral);
 	m_actionInfo.needsNumObjects = 3;
 }
 

Modified: trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortiondialog.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16311&path=/trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortiondialog.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortiondialog.cpp (original)
+++ trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortiondialog.cpp Thu Jan 27 18:21:41 2011
@@ -32,6 +32,7 @@
 #include "commonstrings.h"
 #include "fpointarray.h"
 #include "pageitem.h"
+#include "pageitem_group.h"
 #include "sccolorengine.h"
 #include "scpattern.h"
 #include "selection.h"
@@ -204,12 +205,17 @@
 	itemSelection->setGroupRect();
 	itemSelection->getGroupRect(&gx, &gy, &gw, &gh);
 	uint selectedItemCount = itemSelection->count();
-	w4 = qMax(gw, gh) / 2.0;
-	w2 = qMax(gw, gh);
-	ww = qMax(gw, gh) * 2.0;
+	if (parentItem == 0)
+	{
+		w4 = qMax(gw, gh) / 2.0;
+		w2 = qMax(gw, gh);
+		ww = qMax(gw, gh) * 2.0;
+	}
 	for (uint i = 0; i < selectedItemCount; ++i)
 	{
 		currItem = itemSelection->itemAt(i);
+		if (currItem->isGroup())
+			currItem->asGroupFrame()->adjustXYPosition();
 		FPointArray path = currItem->PoLine;
 		deltaX = ((w2 - gw) / 2.0) + w4;
 		deltaY = ((w2 - gh) / 2.0) + w4;
@@ -227,10 +233,12 @@
 		}
 		else
 		{
-			QTransform mm;
-			mm.rotate(-parent->rotation());
-			mm.translate(-parent->xPos(), -parent->yPos());
-			pItem->setPos(mm.map(QPointF(currItem->xPos(), currItem->yPos())));
+		//	QTransform mm;
+		//	mm.rotate(-parent->rotation());
+		//	mm.translate(-parent->xPos(), -parent->yPos());
+		//	pItem->setPos(mm.map(QPointF(currItem->xPos(), currItem->yPos())));
+			pItem->setPos(QPointF(currItem->gXpos, currItem->gYpos));
+			pItem->rotate(currItem->rotation());
 		}
 		QPainterPath pathO = pp;
 		QTransform mmO;

Modified: trunk/Scribus/scribus/plugins/tools/2geomtools/pathalongpath/pathalongpath.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16311&path=/trunk/Scribus/scribus/plugins/tools/2geomtools/pathalongpath/pathalongpath.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/2geomtools/pathalongpath/pathalongpath.cpp (original)
+++ trunk/Scribus/scribus/plugins/tools/2geomtools/pathalongpath/pathalongpath.cpp Thu Jan 27 18:21:41 2011
@@ -82,6 +82,7 @@
 	m_actionInfo.notSuitableFor.append(PageItem::Symbol);
 	m_actionInfo.notSuitableFor.append(PageItem::RegularPolygon);
 	m_actionInfo.notSuitableFor.append(PageItem::Arc);
+	m_actionInfo.notSuitableFor.append(PageItem::Spiral);
 	m_actionInfo.forAppMode.append(modeNormal);
 	m_actionInfo.needsNumObjects = 2;
 	m_actionInfo.firstObjectType.append(PageItem::PolyLine);

Modified: trunk/Scribus/scribus/plugins/tools/lenseffects/lensdialog.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16311&path=/trunk/Scribus/scribus/plugins/tools/lenseffects/lensdialog.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/lenseffects/lensdialog.cpp (original)
+++ trunk/Scribus/scribus/plugins/tools/lenseffects/lensdialog.cpp Thu Jan 27 18:21:41 2011
@@ -32,6 +32,7 @@
 #include "sccolorengine.h"
 #include "scpattern.h"
 #include "commonstrings.h"
+#include "pageitem_group.h"
 
 LensItem::LensItem(QRectF geom, LensDialog *parent) : QGraphicsRectItem(geom)
 {
@@ -280,6 +281,8 @@
 	for (uint i = 0; i < selectedItemCount; ++i)
 	{
 		currItem = itemSelection->itemAt(i);
+		if (currItem->isGroup())
+			currItem->asGroupFrame()->adjustXYPosition();
 		FPointArray path = currItem->PoLine;
 		QPainterPath pp;
 		if (currItem->itemType() == PageItem::PolyLine)

Modified: trunk/Scribus/scribus/plugins/tools/lenseffects/lenseffects.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16311&path=/trunk/Scribus/scribus/plugins/tools/lenseffects/lenseffects.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/lenseffects/lenseffects.cpp (original)
+++ trunk/Scribus/scribus/plugins/tools/lenseffects/lenseffects.cpp Thu Jan 27 18:21:41 2011
@@ -78,6 +78,7 @@
 	m_actionInfo.notSuitableFor.append(PageItem::Symbol);
 	m_actionInfo.notSuitableFor.append(PageItem::RegularPolygon);
 	m_actionInfo.notSuitableFor.append(PageItem::Arc);
+	m_actionInfo.notSuitableFor.append(PageItem::Spiral);
 	m_actionInfo.needsNumObjects = 3;
 }
 

Modified: trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnect.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16311&path=/trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnect.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnect.cpp (original)
+++ trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnect.cpp Thu Jan 27 18:21:41 2011
@@ -79,6 +79,7 @@
 	m_actionInfo.notSuitableFor.append(PageItem::LatexFrame);
 	m_actionInfo.notSuitableFor.append(PageItem::Symbol);
 	m_actionInfo.notSuitableFor.append(PageItem::RegularPolygon);
+	m_actionInfo.notSuitableFor.append(PageItem::Spiral);
 	m_actionInfo.notSuitableFor.append(PageItem::Arc);
 	m_actionInfo.needsNumObjects = 2;
 }

Modified: trunk/Scribus/scribus/plugins/tools/pathcut/pathcut.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16311&path=/trunk/Scribus/scribus/plugins/tools/pathcut/pathcut.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/pathcut/pathcut.cpp (original)
+++ trunk/Scribus/scribus/plugins/tools/pathcut/pathcut.cpp Thu Jan 27 18:21:41 2011
@@ -86,6 +86,7 @@
 	m_actionInfo.notSuitableFor.append(PageItem::Symbol);
 	m_actionInfo.notSuitableFor.append(PageItem::RegularPolygon);
 	m_actionInfo.notSuitableFor.append(PageItem::Arc);
+	m_actionInfo.notSuitableFor.append(PageItem::Spiral);
 	m_actionInfo.forAppMode.append(modeNormal);
 	m_actionInfo.needsNumObjects = 2;
 	m_actionInfo.firstObjectType.append(PageItem::PolyLine);

Modified: trunk/Scribus/scribus/plugins/tools/pathfinder/pathfinder.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16311&path=/trunk/Scribus/scribus/plugins/tools/pathfinder/pathfinder.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/pathfinder/pathfinder.cpp (original)
+++ trunk/Scribus/scribus/plugins/tools/pathfinder/pathfinder.cpp Thu Jan 27 18:21:41 2011
@@ -93,6 +93,7 @@
 	m_actionInfo.notSuitableFor.append(PageItem::Symbol);
 	m_actionInfo.notSuitableFor.append(PageItem::RegularPolygon);
 	m_actionInfo.notSuitableFor.append(PageItem::Arc);
+	m_actionInfo.notSuitableFor.append(PageItem::Spiral);
 	m_actionInfo.needsNumObjects = 2;
 }
 

Modified: trunk/Scribus/scribus/plugins/tools/pathstroker/pathstroker.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16311&path=/trunk/Scribus/scribus/plugins/tools/pathstroker/pathstroker.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/pathstroker/pathstroker.cpp (original)
+++ trunk/Scribus/scribus/plugins/tools/pathstroker/pathstroker.cpp Thu Jan 27 18:21:41 2011
@@ -87,6 +87,7 @@
 	m_actionInfo.notSuitableFor.append(PageItem::Symbol);
 	m_actionInfo.notSuitableFor.append(PageItem::RegularPolygon);
 	m_actionInfo.notSuitableFor.append(PageItem::Arc);
+	m_actionInfo.notSuitableFor.append(PageItem::Spiral);
 	m_actionInfo.forAppMode.append(modeNormal);
 	m_actionInfo.needsNumObjects = 1;
 }

Modified: trunk/Scribus/scribus/prefsmanager.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16311&path=/trunk/Scribus/scribus/prefsmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/prefsmanager.cpp (original)
+++ trunk/Scribus/scribus/prefsmanager.cpp Thu Jan 27 18:21:41 2011
@@ -271,6 +271,9 @@
 	appPrefs.itemToolPrefs.polyOuterCurvature = 0.0;
 	appPrefs.itemToolPrefs.arcStartAngle = 30.0;
 	appPrefs.itemToolPrefs.arcSweepAngle = 300.0;
+	appPrefs.itemToolPrefs.spiralStartAngle = 0.0;
+	appPrefs.itemToolPrefs.spiralEndAngle = 1080.0;
+	appPrefs.itemToolPrefs.spiralFactor = 1.2;
 //	appPrefs.PSize = 40;
 	appPrefs.printerPrefs.ClipMargin = false;
 	appPrefs.printerPrefs.GCRMode = false;
@@ -1474,6 +1477,9 @@
 	dcItemTools.setAttribute("PolygonOuterCurvature", ScCLocale::toQStringC(appPrefs.itemToolPrefs.polyOuterCurvature));
 	dcItemTools.setAttribute("arcStartAngle", ScCLocale::toQStringC(appPrefs.itemToolPrefs.arcStartAngle));
 	dcItemTools.setAttribute("arcSweepAngle", ScCLocale::toQStringC(appPrefs.itemToolPrefs.arcSweepAngle));
+	dcItemTools.setAttribute("spiralStartAngle", ScCLocale::toQStringC(appPrefs.itemToolPrefs.spiralStartAngle));
+	dcItemTools.setAttribute("spiralEndAngle", ScCLocale::toQStringC(appPrefs.itemToolPrefs.spiralEndAngle));
+	dcItemTools.setAttribute("spiralFactor", ScCLocale::toQStringC(appPrefs.itemToolPrefs.spiralFactor));
 	dcItemTools.setAttribute("PolygonUseFactor", static_cast<int>(appPrefs.itemToolPrefs.polyUseFactor));
 	dcItemTools.setAttribute("ImageScaleType", static_cast<int>(appPrefs.itemToolPrefs.imageScaleType));
 	dcItemTools.setAttribute("ImageAspectRatio", static_cast<int>(appPrefs.itemToolPrefs.imageAspectRatio));
@@ -2068,6 +2074,9 @@
 			appPrefs.itemToolPrefs.lineEndArrow   = dc.attribute("LineEndArrow", "0").toInt();
 			appPrefs.itemToolPrefs.arcStartAngle = ScCLocale::toDoubleC(dc.attribute("arcStartAngle"), 30.0);
 			appPrefs.itemToolPrefs.arcSweepAngle = ScCLocale::toDoubleC(dc.attribute("arcSweepAngle"), 300.0);
+			appPrefs.itemToolPrefs.spiralStartAngle = ScCLocale::toDoubleC(dc.attribute("spiralStartAngle"), 0.0);
+			appPrefs.itemToolPrefs.spiralEndAngle = ScCLocale::toDoubleC(dc.attribute("spiralEndAngle"), 1080.0);
+			appPrefs.itemToolPrefs.spiralFactor = ScCLocale::toDoubleC(dc.attribute("spiralFactor"), 1.2);
 			if (dc.hasAttribute("Face"))
 			{
 				QString tmpf=dc.attribute("Face");

Modified: trunk/Scribus/scribus/prefsstructs.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16311&path=/trunk/Scribus/scribus/prefsstructs.h
==============================================================================
--- trunk/Scribus/scribus/prefsstructs.h (original)
+++ trunk/Scribus/scribus/prefsstructs.h Thu Jan 27 18:21:41 2011
@@ -228,6 +228,10 @@
 	/* Arc Tool */
 	double arcStartAngle;    //! angle where the arc starts
 	double arcSweepAngle;    //! angle the arc spans
+	/* Spiral Tool */
+	double spiralStartAngle;    //! angle where the spiral starts
+	double spiralEndAngle;    //! angle where the spiral ends
+	double spiralFactor;	//! factor the spiral gets smaller
 };
 
 struct OperatorToolPrefs

Modified: trunk/Scribus/scribus/pslib.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16311&path=/trunk/Scribus/scribus/pslib.cpp
==============================================================================
--- trunk/Scribus/scribus/pslib.cpp (original)
+++ trunk/Scribus/scribus/pslib.cpp Thu Jan 27 18:21:41 2011
@@ -2063,6 +2063,7 @@
 			}
 			break;
 		case PageItem::PolyLine:
+		case PageItem::Spiral:
 			if ((c->fillColor() != CommonStrings::None) || (c->GrType != 0))
 			{
 				SetClipPath(&c->PoLine);

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16311&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Thu Jan 27 18:21:41 2011
@@ -810,6 +810,7 @@
 	scrMenuMgr->addMenuItem(scrActions["toolsInsertShape"], "Insert", false);
 	scrMenuMgr->addMenuItem(scrActions["toolsInsertPolygon"], "Insert", false);
 	scrMenuMgr->addMenuItem(scrActions["toolsInsertArc"], "Insert", false);
+	scrMenuMgr->addMenuItem(scrActions["toolsInsertSpiral"], "Insert", false);
 	scrMenuMgr->addMenuItem(scrActions["toolsInsertLine"], "Insert", false);
 	scrMenuMgr->addMenuItem(scrActions["toolsInsertBezier"], "Insert", false);
 	scrMenuMgr->addMenuItem(scrActions["toolsInsertFreehandLine"], "Insert", false);
@@ -2460,6 +2461,7 @@
 	scrActions["toolsInsertCalligraphicLine"]->setEnabled(true);
 	scrActions["toolsInsertPolygon"]->setEnabled(true);
 	scrActions["toolsInsertArc"]->setEnabled(true);
+	scrActions["toolsInsertSpiral"]->setEnabled(true);
 	scrActions["toolsInsertRenderFrame"]->setEnabled(true);
 	scrActions["toolsMeasurements"]->setEnabled(true);
 	scrActions["toolsEyeDropper"]->setEnabled(true);
@@ -2992,13 +2994,16 @@
 			scrActions["itemConvertToPolygon"]->setEnabled(doc->appMode != modeEdit);
 			scrActions["itemConvertToTextFrame"]->setEnabled(false);
 		}
-		else if (SelectedType == PageItem::Line) // Line
+		else if ((SelectedType == PageItem::Line) || (SelectedType == PageItem::Spiral)) // Line
 		{
 			scrMenuMgr->setMenuEnabled("ItemConvertTo", true);
 			scrActions["itemConvertToBezierCurve"]->setEnabled(true);
 			scrActions["itemConvertToImageFrame"]->setEnabled(false);
 			scrActions["itemConvertToOutlines"]->setEnabled(false);
-			scrActions["itemConvertToPolygon"]->setEnabled(false);
+			if (SelectedType == PageItem::Spiral)
+				scrActions["itemConvertToPolygon"]->setEnabled(doc->appMode != modeEdit);
+			else
+				scrActions["itemConvertToPolygon"]->setEnabled(false);
 			scrActions["itemConvertToTextFrame"]->setEnabled(false);
 		}
 		else if (SelectedType == PageItem::Symbol)
@@ -4623,6 +4628,7 @@
 		scrActions["toolsInsertCalligraphicLine"]->setEnabled(false);
 		scrActions["toolsInsertPolygon"]->setEnabled(false);
 		scrActions["toolsInsertArc"]->setEnabled(false);
+		scrActions["toolsInsertSpiral"]->setEnabled(false);
 		scrActions["toolsInsertRenderFrame"]->setEnabled(false);
 		scrActions["toolsLinkTextFrame"]->setEnabled(false);
 		scrActions["toolsUnlinkTextFrame"]->setEnabled(false);
@@ -6110,6 +6116,7 @@
 		scrActions["toolsInsertCalligraphicLine"]->setEnabled(false);
 		scrActions["toolsInsertPolygon"]->setEnabled(false);
 		scrActions["toolsInsertArc"]->setEnabled(false);
+		scrActions["toolsInsertSpiral"]->setEnabled(false);
 		scrActions["toolsInsertRenderFrame"]->setEnabled(false);
 		scrActions["toolsLinkTextFrame"]->setEnabled(false);
 		scrActions["toolsUnlinkTextFrame"]->setEnabled(false);
@@ -6192,6 +6199,7 @@
 	scrActions["toolsInsertCalligraphicLine"]->setEnabled(true);
 	scrActions["toolsInsertPolygon"]->setEnabled(true);
 	scrActions["toolsInsertArc"]->setEnabled(true);
+	scrActions["toolsInsertSpiral"]->setEnabled(true);
 	scrActions["toolsInsertRenderFrame"]->setEnabled(true);
 	scrActions["toolsPDFPushButton"]->setEnabled(true);
 	scrActions["toolsPDFTextField"]->setEnabled(true);
@@ -6282,6 +6290,7 @@
 	scrActions["toolsInsertShape"]->setChecked(mode==modeDrawShapes);
 	scrActions["toolsInsertPolygon"]->setChecked(mode==modeDrawRegularPolygon);
 	scrActions["toolsInsertArc"]->setChecked(mode==modeDrawArc);
+	scrActions["toolsInsertSpiral"]->setChecked(mode==modeDrawSpiral);
 	scrActions["toolsInsertLine"]->setChecked(mode==modeDrawLine);
 	scrActions["toolsInsertBezier"]->setChecked(mode==modeDrawBezierLine);
 	scrActions["toolsInsertFreehandLine"]->setChecked(mode==modeDrawFreehandLine);
@@ -6446,6 +6455,7 @@
 		{
 			case modeDrawShapes:
 			case modeDrawArc:
+			case modeDrawSpiral:
 				if (docSelectionCount!=0)
 					view->Deselect(true);
 				qApp->changeOverrideCursor(QCursor(loadIcon("DrawFrame.xpm")));
@@ -6512,6 +6522,7 @@
 			case modeEditMeshGradient:
 			case modeEditArc:
 			case modeEditPolygon:
+			case modeEditSpiral:
 				qApp->changeOverrideCursor(QCursor(Qt::CrossCursor));
 				break;
 			default:
@@ -9182,6 +9193,7 @@
 	scrActions["toolsInsertCalligraphicLine"]->setEnabled(setter);
 	scrActions["toolsInsertPolygon"]->setEnabled(setter);
 	scrActions["toolsInsertArc"]->setEnabled(setter);
+	scrActions["toolsInsertSpiral"]->setEnabled(setter);
 	scrActions["toolsInsertRenderFrame"]->setEnabled(setter);
 	if (doc->masterPageMode())
 	{

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16311&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Thu Jan 27 18:21:41 2011
@@ -60,6 +60,7 @@
 #include "pageitem_group.h"
 #include "pageitem_regularpolygon.h"
 #include "pageitem_arc.h"
+#include "pageitem_spiral.h"
 #include "ui/pagepalette.h"
 #include "pagesize.h"
 #include "pagestructs.h"
@@ -4032,6 +4033,10 @@
 			newItem = new PageItem_Arc(this, x, y, b, h, w, fill, outline);
 			Q_ASSERT(frameType==PageItem::Rectangle || frameType==PageItem::Ellipse || frameType==PageItem::Unspecified);
 			break;
+		case PageItem::Spiral:
+			newItem = new PageItem_Spiral(this, x, y, b, h, w, fill, outline);
+			Q_ASSERT(frameType==PageItem::Unspecified);
+			break;
 		default:
 //			qDebug() << "unknown item type";
 			assert (false);
@@ -4255,6 +4260,7 @@
 			}
 			break;
 		case PageItem::PolyLine:
+		case PageItem::Spiral:
 			newItem->ClipEdited = true;
 			break;
 		case PageItem::PathText:
@@ -4290,7 +4296,7 @@
 	}
 
 	//ItemType Polygon
-	if (itemType==PageItem::Polygon || itemType==PageItem::PolyLine || itemType == PageItem::RegularPolygon || itemType == PageItem::Arc)
+	if (itemType==PageItem::Polygon || itemType==PageItem::PolyLine || itemType==PageItem::Spiral || itemType == PageItem::RegularPolygon || itemType == PageItem::Arc)
 	{
 		newItem->PLineArt = Qt::PenStyle(docPrefsData.itemToolPrefs.shapeLineStyle);
 		newItem->setFillShade(docPrefsData.itemToolPrefs.shapeFillColorShade);
@@ -4985,6 +4991,7 @@
 		case PageItem::PolyLine:
 			newItem->convertTo(PageItem::PolyLine);
 			newItem->ClipEdited = true;
+			newItem->FrameType = 3;
 			if(oldItem->itemType()==PageItem::Line)
 			{
 				QTransform ma;
@@ -5927,7 +5934,7 @@
 			//cb moved to setlinewidth
 			//currItem->Oldm_lineWidth = currItem->lineWidth();
 			currItem->setLineWidth(w);
-			if (currItem->asPolyLine())
+			if (currItem->asPolyLine() || currItem->asSpiral())
 				currItem->setPolyClip(qRound(qMax(currItem->lineWidth() / 2, 1.0)));
 			if (currItem->asLine())
 			{
@@ -6351,6 +6358,7 @@
 							case PageItem::Polygon:
 							case PageItem::ImageFrame:
 							case PageItem::LatexFrame:
+							case PageItem::Spiral:
 								currItem->setLineColor(docPrefsData.itemToolPrefs.shapeLineColor);
 								break;
 							default:
@@ -6398,6 +6406,7 @@
 								case PageItem::Line:
 								case PageItem::PolyLine:
 								case PageItem::Polygon:
+								case PageItem::Spiral:
 									currItem->setFillColor(docPrefsData.itemToolPrefs.shapeFillColor);
 									break;
 								default:
@@ -10852,7 +10861,7 @@
 	for (uint a = 0; a < selectedItemCount; ++a)
 	{
 		PageItem *currItem = itemSelection->itemAt(a);
-		if (!(currItem->asLine() || currItem->asPolyLine()))
+		if (!(currItem->asLine() || currItem->asPolyLine() || currItem->asSpiral()))
 			continue;
 		if (startArrowID!=-1)
 		{
@@ -10895,7 +10904,7 @@
 	for (uint a = 0; a < selectedItemCount; ++a)
 	{
 		PageItem *currItem = itemSelection->itemAt(a);
-		if (!(currItem->asLine() || currItem->asPolyLine()))
+		if (!(currItem->asLine() || currItem->asPolyLine() || currItem->asSpiral()))
 			continue;
 		if (startArrowSc !=  -1)
 		{
@@ -11518,7 +11527,7 @@
 	currItem->ClipEdited = true;
 	currItem->OldB2 = currItem->width();
 	currItem->OldH2 = currItem->height();
-	if (currItem->asPolyLine())
+	if (currItem->asPolyLine() || currItem->asSpiral())
 		currItem->setPolyClip(qRound(qMax(currItem->lineWidth() / 2, 1.0)));
 	else if (currItem->asPathText())
 		currItem->updatePolyClip();
@@ -11643,6 +11652,14 @@
 				dsch = item->arcHeight / bb->height();
 			if (bb->width() != 0.0)
 				dscw = item->arcWidth / bb->width();
+		}
+		if (bb->isSpiral())
+		{
+			PageItem_Spiral* item = bb->asSpiral();
+			if (bb->height() != 0.0)
+				dsch = item->spiralHeight / bb->height();
+			if (bb->width() != 0.0)
+				dscw = item->spiralWidth / bb->width();
 		}
 		bb->Sizing = false;
 		double oldRot, oldLocalX, oldLocalY;
@@ -11700,6 +11717,15 @@
 				FPoint tp2(getMinClipF(&bb->PoLine));
 				bb->PoLine.translate(-tp2.x(), -tp2.y());
 			}
+			if (bb->isSpiral())
+			{
+				PageItem_Spiral* item = bb->asSpiral();
+				item->spiralWidth += dw * dscw;
+				item->spiralHeight += dh * dsch;
+				item->recalcPath();
+				FPoint tp2(getMinClipF(&bb->PoLine));
+				bb->PoLine.translate(-tp2.x(), -tp2.y());
+			}
 			AdjustItemSize(bb, true, false);
 			QTransform ma3;
 			ma3.translate(gx, gy);

Modified: trunk/Scribus/scribus/scribusstructs.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16311&path=/trunk/Scribus/scribus/scribusstructs.h
==============================================================================
--- trunk/Scribus/scribus/scribusstructs.h (original)
+++ trunk/Scribus/scribus/scribusstructs.h Thu Jan 27 18:21:41 2011
@@ -313,7 +313,9 @@
 	modeDrawCalligraphicLine,
 	modeDrawArc,
 	modeEditArc,
-	modeEditPolygon
+	modeEditPolygon,
+	modeDrawSpiral,
+	modeEditSpiral
 };
 
 struct AlignObjs

Modified: trunk/Scribus/scribus/scribusview.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16311&path=/trunk/Scribus/scribus/scribusview.h
==============================================================================
--- trunk/Scribus/scribus/scribusview.h (original)
+++ trunk/Scribus/scribus/scribusview.h Thu Jan 27 18:21:41 2011
@@ -103,6 +103,7 @@
 	friend class CanvasMode_EditMeshGradient;
 	friend class CanvasMode_EditPolygon;
 	friend class CanvasMode_EditArc;
+	friend class CanvasMode_EditSpiral;
 	friend class CanvasMode_FrameLinks;
 	friend class CanvasMode_Magnifier;
 	friend class CanvasMode_NodeEdit;

Modified: trunk/Scribus/scribus/ui/about.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16311&path=/trunk/Scribus/scribus/ui/about.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/about.cpp (original)
+++ trunk/Scribus/scribus/ui/about.cpp Thu Jan 27 18:21:41 2011
@@ -112,7 +112,7 @@
 	buildID = new QLabel( tab );
 	buildID->setAlignment(Qt::AlignCenter);
 	buildID->setTextInteractionFlags(Qt::TextSelectableByMouse);
-	QString BUILD_DAY = "23";
+	QString BUILD_DAY = "27";
 	QString BUILD_MONTH = CommonStrings::january;
 	QString BUILD_YEAR = "2011";
 	QString BUILD_TIME = "";

Modified: trunk/Scribus/scribus/ui/arcvectordialog.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16311&path=/trunk/Scribus/scribus/ui/arcvectordialog.h
==============================================================================
--- trunk/Scribus/scribus/ui/arcvectordialog.h (original)
+++ trunk/Scribus/scribus/ui/arcvectordialog.h Thu Jan 27 18:21:41 2011
@@ -22,7 +22,7 @@
  ***************************************************************************/
 
 #ifndef ARCVECTOR_H
-#define ARcVECTOR_H
+#define ARCVECTOR_H
 
 #include "ui_arcvectorbase.h"
 

Modified: trunk/Scribus/scribus/ui/modetoolbar.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16311&path=/trunk/Scribus/scribus/ui/modetoolbar.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/modetoolbar.cpp (original)
+++ trunk/Scribus/scribus/ui/modetoolbar.cpp Thu Jan 27 18:21:41 2011
@@ -72,6 +72,7 @@
 	tb2->setPopupMode(QToolButton::MenuButtonPopup);
 
 	this->addAction(m_ScMW->scrActions["toolsInsertArc"]);
+	this->addAction(m_ScMW->scrActions["toolsInsertSpiral"]);
 	this->addAction(m_ScMW->scrActions["toolsInsertLine"]);
 	this->addAction(m_ScMW->scrActions["toolsInsertBezier"]);
 	this->addAction(m_ScMW->scrActions["toolsInsertFreehandLine"]);

Modified: trunk/Scribus/scribus/ui/outlinepalette.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16311&path=/trunk/Scribus/scribus/ui/outlinepalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/outlinepalette.cpp (original)
+++ trunk/Scribus/scribus/ui/outlinepalette.cpp Thu Jan 27 18:21:41 2011
@@ -133,6 +133,7 @@
 							tipText = CommonStrings::itemType_Polygon;
  							break;
  						case PageItem::PolyLine:
+						case PageItem::Spiral:
 							tipText = CommonStrings::itemType_Polyline;
  							break;
  						case PageItem::PathText:
@@ -495,6 +496,7 @@
 		item->setIcon( 0, polygonIcon );
 		break;
 	case PageItem::PolyLine:
+	case PageItem::Spiral:
 		item->setIcon( 0, polylineIcon );
 		break;
 	case PageItem::PathText:

Modified: trunk/Scribus/scribus/ui/propertiespalette.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16311&path=/trunk/Scribus/scribus/ui/propertiespalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette.cpp (original)
+++ trunk/Scribus/scribus/ui/propertiespalette.cpp Thu Jan 27 18:21:41 2011
@@ -56,6 +56,7 @@
 #include "pageitem_textframe.h"
 #include "pageitem_regularpolygon.h"
 #include "pageitem_arc.h"
+#include "pageitem_spiral.h"
 #include "polyprops.h"
 #include "sccombobox.h"
 #include "scfonts.h"
@@ -1612,7 +1613,7 @@
 		SCustom->setIcon(SCustom->getIconPixmap(1));
 	if (CurItem->FrameType > 3)
 		SCustom->setIcon(SCustom->getIconPixmap(CurItem->FrameType-2));
-	if ((CurItem->asLine()) || (CurItem->asPolyLine()))
+	if ((CurItem->asLine()) || (CurItem->asPolyLine()) || (CurItem->asSpiral()))
 	{
 		startArrow->setEnabled(true);
 		endArrow->setEnabled(true);
@@ -2105,7 +2106,7 @@
 			i=doc->m_Selection->itemAt(0);
 			HaveItem=true;
 			EditShape->setEnabled(!i->locked());
-			SCustom->setEnabled(nr!=5 && nr!=7 && nr!=8 && nr!=13 && nr!=14 && !i->locked());
+			SCustom->setEnabled(nr!=5 && nr!=7 && nr!=8 && nr!=13 && nr!=14 && nr!=15 && !i->locked());
 		}
 		else
 		{
@@ -2235,6 +2236,7 @@
 				RoundRect->setEnabled(false);
 			break;
 		case PageItem::PolyLine:
+		case PageItem::Spiral:
 			TabStack->setItemEnabled(idShapeItem, true);
 			TabStack->setItemEnabled(idTextItem, false);
 			TabStack->setItemEnabled(idImageItem, false);
@@ -3228,7 +3230,21 @@
 			CurItem->PoLine.translate(-tp2.x(), -tp2.y());
 			doc->AdjustItemSize(CurItem);
 		}
-		if (CurItem->isArc() || CurItem->isRegularPolygon())
+		if (CurItem->isSpiral())
+		{
+			double dw = w - oldW;
+			double dh = h - oldH;
+			PageItem_Spiral* item = CurItem->asSpiral();
+			double dsch = item->spiralHeight / oldH;
+			double dscw = item->spiralWidth / oldW;
+			item->spiralWidth += dw * dscw;
+			item->spiralHeight += dh * dsch;
+			item->recalcPath();
+			FPoint tp2(getMinClipF(&CurItem->PoLine));
+			CurItem->PoLine.translate(-tp2.x(), -tp2.y());
+			doc->AdjustItemSize(CurItem);
+		}
+		if (CurItem->isArc() || CurItem->isRegularPolygon() || CurItem->isSpiral())
 			emit updateEditItem();
 		CurItem->Sizing = oldS;
 	}
@@ -3353,7 +3369,21 @@
 			CurItem->PoLine.translate(-tp2.x(), -tp2.y());
 			doc->AdjustItemSize(CurItem);
 		}
-		if (CurItem->isArc() || CurItem->isRegularPolygon())
+		if (CurItem->isSpiral())
+		{
+			double dw = w - oldW;
+			double dh = h - oldH;
+			PageItem_Spiral* item = CurItem->asSpiral();
+			double dsch = item->spiralHeight / oldH;
+			double dscw = item->spiralWidth / oldW;
+			item->spiralWidth += dw * dscw;
+			item->spiralHeight += dh * dsch;
+			item->recalcPath();
+			FPoint tp2(getMinClipF(&CurItem->PoLine));
+			CurItem->PoLine.translate(-tp2.x(), -tp2.y());
+			doc->AdjustItemSize(CurItem);
+		}
+		if (CurItem->isArc() || CurItem->isRegularPolygon() || CurItem->isSpiral())
 			emit updateEditItem();
 		emit DocChanged();
 		doc->regionsChanged()->update(QRect());
@@ -4160,6 +4190,11 @@
 		else if (CurItem->asArc())
 		{
 			m_ScMW->view->requestMode(modeEditArc);
+			RoundRect->setEnabled(false);
+		}
+		else if (CurItem->asSpiral())
+		{
+			m_ScMW->view->requestMode(modeEditSpiral);
 			RoundRect->setEnabled(false);
 		}
 		else
@@ -5347,7 +5382,7 @@
 	Locked->setChecked(isLocked);
 	if ((HaveDoc) && (HaveItem))
 	{
-		SCustom->setEnabled(!CurItem->asLine() && !CurItem->asPolyLine() && !CurItem->asPathText() && !isLocked);
+		SCustom->setEnabled(!CurItem->asLine() && !CurItem->asPolyLine() && !CurItem->asSpiral() && !CurItem->asPathText() && !isLocked);
 		if (((CurItem->asTextFrame()) || (CurItem->asImageFrame()) || (CurItem->asPolygon())) &&  (!CurItem->ClipEdited) && ((CurItem->FrameType == 0) || (CurItem->FrameType == 2)))
 			RoundRect->setEnabled(!isLocked);
 		else

Modified: trunk/Scribus/scribus/util_math.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16311&path=/trunk/Scribus/scribus/util_math.cpp
==============================================================================
--- trunk/Scribus/scribus/util_math.cpp (original)
+++ trunk/Scribus/scribus/util_math.cpp Thu Jan 27 18:21:41 2011
@@ -161,6 +161,114 @@
 	return pts;
 }
 
+QPainterPath SpiralPath(double spiralWidth, double spiralHeight, double spiralStartAngle, double spiralEndAngle, double spiralFactor)
+{
+	if (spiralStartAngle >= spiralEndAngle)
+		return QPainterPath();
+	double startAngleK = spiralStartAngle;
+	double endAngleK = spiralEndAngle;
+	QPainterPath path, path2;
+	double sh = spiralHeight / (spiralFactor + 1.0);
+	double sw = 0.0;
+	double ww = spiralWidth;
+	double hh = spiralHeight - sh;
+	double segStart = 0.0;
+	double segEnd = 180.0;
+	double spanAngle = 180.0;
+	double startAngle = 0.0;
+	bool segPart = true;
+	bool draw = false;
+	QPointF tp;
+	path2.moveTo(sw, sh);
+	while (segStart < endAngleK)
+	{
+		if (startAngleK >= segEnd)
+		{
+			tp = path2.currentPosition();
+			if (segPart)
+			{
+				sw = tp.x();
+				sh = spiralHeight / (spiralFactor + 1.0);
+				path2.arcTo(sw, sh - hh, ww, hh * 2, 180, 180);
+			}
+			else
+			{
+				sw = tp.x() - ww;
+				sh = spiralHeight / (spiralFactor + 1.0) - hh;
+				path2.arcTo(sw, sh, ww, hh * 2, 0, 180);
+			}
+			segPart = !segPart;
+			ww /= spiralFactor;
+			hh /= spiralFactor;
+			segStart += 180.0;
+			segEnd += 180.0;
+			spanAngle = 180.0;
+			continue;
+		}
+		if ((startAngleK >= segStart) && (startAngleK <= segEnd))
+		{
+			startAngle = startAngleK + 180;
+			spanAngle = segEnd - startAngleK;
+			if ((endAngleK >= segStart) && (endAngleK <= segEnd))
+				spanAngle -= segEnd - endAngleK;
+			if (segPart)
+			{
+				sw = tp.x();
+				sh = spiralHeight / (spiralFactor + 1.0);
+				path.arcMoveTo(sw, sh - hh, ww, hh * 2, startAngle);
+				path.arcTo(sw, sh - hh, ww, hh * 2, startAngle, spanAngle);
+				startAngle = 0.0;
+			}
+			else
+			{
+				sw = tp.x() - ww;
+				sh = spiralHeight / (spiralFactor + 1.0) - hh;
+				path.arcMoveTo(sw, sh, ww, hh * 2, startAngle);
+				path.arcTo(sw, sh, ww, hh * 2, startAngle, spanAngle);
+				startAngle = 180.0;
+			}
+			draw = true;
+			segPart = !segPart;
+			ww /= spiralFactor;
+			hh /= spiralFactor;
+			if ((endAngleK >= segStart) && (endAngleK <= segEnd))
+				break;
+			segStart += 180.0;
+			segEnd += 180.0;
+			spanAngle = 180.0;
+			continue;
+		}
+		if ((endAngleK >= segStart) && (endAngleK <= segEnd))
+			spanAngle -= segEnd - endAngleK;
+		tp = path.currentPosition();
+		if (segPart)
+		{
+			sw = tp.x();
+			sh = tp.y();
+			if (draw)
+				path.arcTo(sw, sh - hh, ww, hh * 2, startAngle, spanAngle);
+			startAngle = 0.0;
+		}
+		else
+		{
+			sw = tp.x() - ww;
+			sh = tp.y() - hh;
+			if (draw)
+				path.arcTo(sw, sh, ww, hh * 2, startAngle, spanAngle);
+			startAngle = 180.0;
+		}
+		segPart = !segPart;
+		ww /= spiralFactor;
+		hh /= spiralFactor;
+		if ((endAngleK >= segStart) && (endAngleK <= segEnd))
+			break;
+		segStart += 180.0;
+		segEnd += 180.0;
+		spanAngle = 180.0;
+	}
+	return path;
+}
+
 QList<QPainterPath> decomposePath(QPainterPath &path)
 {
 	QList<QPainterPath> ret;

Modified: trunk/Scribus/scribus/util_math.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16311&path=/trunk/Scribus/scribus/util_math.h
==============================================================================
--- trunk/Scribus/scribus/util_math.h (original)
+++ trunk/Scribus/scribus/util_math.h Thu Jan 27 18:21:41 2011
@@ -35,6 +35,7 @@
 QPolygon SCRIBUS_API FlattenPath(const FPointArray& ina, QList<uint> &Segs);
 QList<QPainterPath> SCRIBUS_API decomposePath(QPainterPath &path);
 QPainterPath SCRIBUS_API RegularPolygonPath(double w, double h, uint c, bool star, double factor, double rota, double factor2 = 0.0, double innerRot = 0.0, double factor3 = 0.0);
+QPainterPath SCRIBUS_API SpiralPath(double spiralWidth, double spiralHeight, double spiralStartAngle, double spiralEndAngle, double spiralFactor);
 uint SCRIBUS_API getDouble(QString in, bool raw);
 inline double SCRIBUS_API sind(double);
 inline double SCRIBUS_API cosd(double);




More information about the scribus-commit mailing list