r16321 by fschmid - Added a new Tool-Plugin "Smooth Path"

scribus-commit scribus-commit at lists.scribus.net
Sun Jan 30 13:37:54 CET 2011


Author: fschmid
Date: Sun Jan 30 12:37:53 2011
New Revision: 16321

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=16321
Log:
Added a new Tool-Plugin "Smooth Path"

Added:
    trunk/Scribus/scribus/plugins/tools/smoothpath/
    trunk/Scribus/scribus/plugins/tools/smoothpath/CMakeLists.txt
    trunk/Scribus/scribus/plugins/tools/smoothpath/smoothpath.cpp
    trunk/Scribus/scribus/plugins/tools/smoothpath/smoothpath.h
Modified:
    trunk/Scribus/scribus/KarbonCurveFit.cpp
    trunk/Scribus/scribus/KarbonCurveFit.h
    trunk/Scribus/scribus/canvasmode_nodeedit.cpp
    trunk/Scribus/scribus/plugins/tools/CMakeLists.txt

Modified: trunk/Scribus/scribus/KarbonCurveFit.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16321&path=/trunk/Scribus/scribus/KarbonCurveFit.cpp
==============================================================================
--- trunk/Scribus/scribus/KarbonCurveFit.cpp (original)
+++ trunk/Scribus/scribus/KarbonCurveFit.cpp Sun Jan 30 12:37:53 2011
@@ -537,7 +537,8 @@
 }
 
 
-QPainterPath bezierFit(const QList<QPointF> &points,float error){
+QPainterPath bezierFit(const QList<QPointF> &points,float error)
+{
 	FitVector tHat1, tHat2;
 
 	tHat1 = ComputeLeftTangent(points,0);
@@ -561,3 +562,8 @@
 	return path;
 }
 
+QPainterPath bezierFit( const QPolygonF &points, float error )
+{
+	QList<QPointF> clip = QList<QPointF>::fromVector(points);
+	return bezierFit(clip, error);
+}

Modified: trunk/Scribus/scribus/KarbonCurveFit.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16321&path=/trunk/Scribus/scribus/KarbonCurveFit.h
==============================================================================
--- trunk/Scribus/scribus/KarbonCurveFit.h (original)
+++ trunk/Scribus/scribus/KarbonCurveFit.h Sun Jan 30 12:37:53 2011
@@ -26,6 +26,7 @@
 #include <QList>
 #include <QPointF>
 #include <QPainterPath>
+#include <QPolygonF>
 
 /*
  * Fits bezier curve to given list of points.
@@ -43,6 +44,7 @@
  */
 
 QPainterPath bezierFit( const QList<QPointF> &points, float error );
+QPainterPath bezierFit( const QPolygonF &points, float error );
 
 #endif
 

Modified: trunk/Scribus/scribus/canvasmode_nodeedit.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16321&path=/trunk/Scribus/scribus/canvasmode_nodeedit.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_nodeedit.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_nodeedit.cpp Sun Jan 30 12:37:53 2011
@@ -1081,8 +1081,19 @@
 	if (edited)
 	{
 		currItem->FrameType = 3;
+		double xp, yp, w, h, xp2, yp2, w2, h2;
+		xp = currItem->xPos();
+		yp = currItem->yPos();
+		w = currItem->width();
+		h = currItem->height();
 		m_doc->AdjustItemSize(currItem);
+		xp2 = currItem->xPos();
+		yp2 = currItem->yPos();
+		w2 = currItem->width();
+		h2 = currItem->height();
 		currItem->update();
+		if ((xp != xp2) || (yp != yp2) || (w != w2) || (h != h2))
+			m_view->DrawNew();
 	}
 	if ((m_doc->nodeEdit.SelNode.count() != 0) || ((m_doc->nodeEdit.SegP1 != -1) && (m_doc->nodeEdit.SegP2 != -1)) || (m_doc->nodeEdit.hasNodeSelected() && (!m_doc->nodeEdit.EdPoints)))
 	{

Modified: trunk/Scribus/scribus/plugins/tools/CMakeLists.txt
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16321&path=/trunk/Scribus/scribus/plugins/tools/CMakeLists.txt
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/CMakeLists.txt (original)
+++ trunk/Scribus/scribus/plugins/tools/CMakeLists.txt Sun Jan 30 12:37:53 2011
@@ -8,6 +8,8 @@
 ADD_SUBDIRECTORY(pathfinder)
 ADD_SUBDIRECTORY(pathstroker)
 ADD_SUBDIRECTORY(subdivide)
+ADD_SUBDIRECTORY(flattenpath)
+ADD_SUBDIRECTORY(smoothpath)
 if (HAVE_ASPELL)
   ADD_SUBDIRECTORY(spellcheck)
 endif (HAVE_ASPELL)




More information about the scribus-commit mailing list