r16869 by fschmid - - Added the ability to edit Patch Meshes.

scribus-commit scribus-commit at lists.scribus.net
Mon Oct 3 07:47:18 UTC 2011


Author: fschmid
Date: Mon Oct  3 07:47:18 2011
New Revision: 16869

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=16869
Log:
- Added the ability to edit Patch Meshes.
- Added the "Color Control" points to mesh gradients.
- Fixed export of mesh gradients to PostScript

Added:
    trunk/Scribus/scribus/canvasmode_editmeshpatch.cpp
    trunk/Scribus/scribus/canvasmode_editmeshpatch.h
Modified:
    trunk/Scribus/scribus/CMakeLists.txt
    trunk/Scribus/scribus/canvas.cpp
    trunk/Scribus/scribus/canvas.h
    trunk/Scribus/scribus/canvasmode.cpp
    trunk/Scribus/scribus/canvasmode_editmeshgradient.cpp
    trunk/Scribus/scribus/canvasmode_editmeshgradient.h
    trunk/Scribus/scribus/mesh.cpp
    trunk/Scribus/scribus/mesh.h
    trunk/Scribus/scribus/pageitem.cpp
    trunk/Scribus/scribus/pageitem.h
    trunk/Scribus/scribus/pdflib_core.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
    trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
    trunk/Scribus/scribus/pslib.cpp
    trunk/Scribus/scribus/pslib.h
    trunk/Scribus/scribus/scpainter.cpp
    trunk/Scribus/scribus/scribusstructs.h
    trunk/Scribus/scribus/scribusview.cpp
    trunk/Scribus/scribus/scribusview.h
    trunk/Scribus/scribus/ui/cpalette.cpp
    trunk/Scribus/scribus/ui/cpalette.h
    trunk/Scribus/scribus/ui/gradientvectorbase.ui
    trunk/Scribus/scribus/ui/gradientvectordialog.cpp
    trunk/Scribus/scribus/ui/gradientvectordialog.h
    trunk/Scribus/scribus/ui/outlinepalette.cpp
    trunk/Scribus/scribus/ui/propertiespalette.cpp

Modified: trunk/Scribus/scribus/CMakeLists.txt
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16869&path=/trunk/Scribus/scribus/CMakeLists.txt
==============================================================================
--- trunk/Scribus/scribus/CMakeLists.txt (original)
+++ trunk/Scribus/scribus/CMakeLists.txt Mon Oct  3 07:47:18 2011
@@ -484,6 +484,7 @@
   canvasmode_editarc.cpp
   canvasmode_editgradient.cpp
   canvasmode_editmeshgradient.cpp
+  canvasmode_editmeshpatch.cpp
   canvasmode_editpolygon.cpp
   canvasmode_editspiral.cpp
   canvasmode_edittable.cpp

Modified: trunk/Scribus/scribus/canvas.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16869&path=/trunk/Scribus/scribus/canvas.cpp
==============================================================================
--- trunk/Scribus/scribus/canvas.cpp (original)
+++ trunk/Scribus/scribus/canvas.cpp Mon Oct  3 07:47:18 2011
@@ -274,6 +274,13 @@
 	int radius = m_doc->guidesPrefs().grabRadius;
 	return qAbs(localPoint1.x() - localPoint2.x()) < radius
 		&& qAbs(localPoint1.y() - localPoint2.y()) < radius;
+}
+
+bool Canvas::hitsCanvasPoint(FPoint globalPoint, QPointF canvasPoint) const
+{
+	double radius = m_doc->guidesPrefs().grabRadius;
+	return qAbs(globalPoint.x() - canvasPoint.x()) < radius
+		&& qAbs(globalPoint.y() - canvasPoint.y()) < radius;
 }
 
 QRect Canvas::exposedRect() const

Modified: trunk/Scribus/scribus/canvas.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16869&path=/trunk/Scribus/scribus/canvas.h
==============================================================================
--- trunk/Scribus/scribus/canvas.h (original)
+++ trunk/Scribus/scribus/canvas.h Mon Oct  3 07:47:18 2011
@@ -93,6 +93,7 @@
 	friend class CanvasMode_EditArc;
 	friend class CanvasMode_EditGradient;
 	friend class CanvasMode_EditMeshGradient;
+	friend class CanvasMode_EditMeshPatch;
 	friend class CanvasMode_EditPolygon;
 	friend class CanvasMode_EditSpiral;
 	friend class CanvasMode_EditTable;
@@ -160,6 +161,7 @@
 //	QRectF globalToCanvas(QRectF p) const;
 	bool hitsCanvasPoint(QPoint globalPoint, FPoint canvasPoint) const;
 	bool hitsCanvasPoint(QPoint globalPoint, QPointF canvasPoint) const;
+	bool hitsCanvasPoint(FPoint globalPoint, QPointF canvasPoint) const;
 	QRect exposedRect() const;
 	bool cursorOverTextFrameControl(QPoint globalPos, PageItem* frame);
 	/** Returns the framehandle or INSIDE if the position falls into the frame. */

Modified: trunk/Scribus/scribus/canvasmode.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16869&path=/trunk/Scribus/scribus/canvasmode.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode.cpp (original)
+++ trunk/Scribus/scribus/canvasmode.cpp Mon Oct  3 07:47:18 2011
@@ -27,6 +27,7 @@
 #include "canvasmode_editarc.h"
 #include "canvasmode_editgradient.h"
 #include "canvasmode_editmeshgradient.h"
+#include "canvasmode_editmeshpatch.h"
 #include "canvasmode_editpolygon.h"
 #include "canvasmode_editspiral.h"
 #include "canvasmode_edittable.h"
@@ -127,6 +128,9 @@
 		case modeEditMeshGradient:
 			result = new CanvasMode_EditMeshGradient(view);
 			break;
+		case modeEditMeshPatch:
+			result = new CanvasMode_EditMeshPatch(view);
+			break;
 		case modeDrawBezierLine:
 			result = new BezierMode(view);
 			break;

Modified: trunk/Scribus/scribus/canvasmode_editmeshgradient.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16869&path=/trunk/Scribus/scribus/canvasmode_editmeshgradient.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editmeshgradient.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_editmeshgradient.cpp Mon Oct  3 07:47:18 2011
@@ -98,8 +98,8 @@
 	QPen p8b = QPen(Qt::blue, 8.0 / m_canvas->m_viewMode.scale, Qt::SolidLine, Qt::RoundCap, Qt::MiterJoin);
 	QPen p8r = QPen(Qt::red, 8.0 / m_canvas->m_viewMode.scale, Qt::SolidLine, Qt::RoundCap, Qt::MiterJoin);
 	QPen p8m = QPen(Qt::magenta, 8.0 / m_canvas->m_viewMode.scale, Qt::SolidLine, Qt::RoundCap, Qt::MiterJoin);
-	QPen p14r = QPen(Qt::red, 14.0 / m_canvas->m_viewMode.scale, Qt::SolidLine, Qt::RoundCap, Qt::MiterJoin);
-	QPen p14w = QPen(Qt::white, 14.0 / m_canvas->m_viewMode.scale, Qt::SolidLine, Qt::RoundCap, Qt::MiterJoin);
+	QPen p14r = QPen(Qt::red, 18.0 / m_canvas->m_viewMode.scale, Qt::SolidLine, Qt::RoundCap, Qt::MiterJoin);
+	QPen p14w = QPen(Qt::white, 18.0 / m_canvas->m_viewMode.scale, Qt::SolidLine, Qt::RoundCap, Qt::MiterJoin);
 	psx->translate(static_cast<int>(currItem->xPos()), static_cast<int>(currItem->yPos()));
 	psx->rotate(currItem->rotation());
 	psx->setPen(p1b);
@@ -151,8 +151,13 @@
 				else
 					psx->setPen(p14w);
 				psx->drawPoint(QPointF(mp1.gridPoint.x(), mp1.gridPoint.y()));
-				psx->setPen(QPen(mp1.color, 10.0 / m_canvas->m_viewMode.scale, Qt::SolidLine, Qt::RoundCap, Qt::MiterJoin));
+				psx->setPen(QPen(mp1.color, 14.0 / m_canvas->m_viewMode.scale, Qt::SolidLine, Qt::RoundCap, Qt::MiterJoin));
 				psx->drawPoint(QPointF(mp1.gridPoint.x(), mp1.gridPoint.y()));
+				if (isSelected)
+					psx->setPen(p8r);
+				else
+					psx->setPen(p8m);
+				psx->drawPoint(QPointF(mp1.controlColor.x(), mp1.controlColor.y()));
 			}
 			else if (m_view->editStrokeGradient == 7)
 			{
@@ -358,6 +363,7 @@
 	m_canvas->m_viewMode.operItemResizing = false;
 	m_view->MidButt = false;
 	selectedMeshPoints.clear();
+	m_keyRepeat = false;
 	Mxp = Myp = -1;
 	setModeCursor();
 	if (fromGesture)
@@ -372,6 +378,159 @@
 	selectedMeshPoints.clear();
 	m_gradientPoint = noPointDefined;
 	m_ScMW->propertiesPalette->updateColorSpecialGradient();
+}
+
+void CanvasMode_EditMeshGradient::keyPressEvent(QKeyEvent *e)
+{
+	if (selectedMeshPoints.count() == 0)
+		return;
+	int kk = e->key();
+	if (m_keyRepeat)
+		return;
+	m_keyRepeat = true;
+	e->accept();
+	Qt::KeyboardModifiers buttonModifiers = e->modifiers();
+	if ((!m_view->zoomSpinBox->hasFocus()) && (!m_view->pageSelector->hasFocus()))
+	{
+		if (m_doc->m_Selection->count() != 0)
+		{
+			double moveBy = 1.0;
+			double moveX = 0.0;
+			double moveY = 0.0;
+			bool isMoving = false;
+			bool doUpdate = false;
+			if (m_doc->unitIndex()!=SC_INCHES)
+			{
+				if ((buttonModifiers & Qt::ShiftModifier) && !(buttonModifiers & Qt::ControlModifier) && !(buttonModifiers & Qt::AltModifier))
+					moveBy=0.1;
+				else if (!(buttonModifiers & Qt::ShiftModifier) && (buttonModifiers & Qt::ControlModifier) && !(buttonModifiers & Qt::AltModifier))
+					moveBy=10.0;
+				else if ((buttonModifiers & Qt::ShiftModifier) && (buttonModifiers & Qt::ControlModifier) && !(buttonModifiers & Qt::AltModifier))
+					moveBy=0.01;
+				moveBy/=m_doc->unitRatio();//Lets allow movement by the current doc ratio, not only points
+			}
+			else
+			{
+				if ((buttonModifiers & Qt::ShiftModifier) && !(buttonModifiers & Qt::ControlModifier) && !(buttonModifiers & Qt::AltModifier))
+					moveBy=0.1/m_doc->unitRatio();
+				else if (!(buttonModifiers & Qt::ShiftModifier) && (buttonModifiers & Qt::ControlModifier) && !(buttonModifiers & Qt::AltModifier))
+					moveBy=1.0/m_doc->unitRatio();
+				else if ((buttonModifiers & Qt::ShiftModifier) && (buttonModifiers & Qt::ControlModifier) && !(buttonModifiers & Qt::AltModifier))
+					moveBy=0.01/m_doc->unitRatio();
+			}
+			moveBy /= m_canvas->m_viewMode.scale;
+			PageItem *currItem = m_doc->m_Selection->itemAt(0);
+			switch (kk)
+			{
+				case Qt::Key_7:
+					moveX = -moveBy;
+					moveY = -moveBy;
+					isMoving = true;
+					doUpdate = true;
+					break;
+				case Qt::Key_9:
+					moveX = moveBy;
+					moveY = -moveBy;
+					isMoving = true;
+					doUpdate = true;
+					break;
+				case Qt::Key_3:
+					moveX = moveBy;
+					moveY = moveBy;
+					isMoving = true;
+					doUpdate = true;
+					break;
+				case Qt::Key_1:
+					moveX = -moveBy;
+					moveY = moveBy;
+					isMoving = true;
+					doUpdate = true;
+					break;
+				case Qt::Key_Left:
+				case Qt::Key_4:
+					moveX = -moveBy;
+					isMoving = true;
+					doUpdate = true;
+					break;
+				case Qt::Key_Right:
+				case Qt::Key_6:
+					moveX = moveBy;
+					isMoving = true;
+					doUpdate = true;
+					break;
+				case Qt::Key_Up:
+				case Qt::Key_8:
+					moveY = -moveBy;
+					isMoving = true;
+					doUpdate = true;
+					break;
+				case Qt::Key_Down:
+				case Qt::Key_2:
+					moveY = moveBy;
+					isMoving = true;
+					doUpdate = true;
+					break;
+				case Qt::Key_5:
+					if (m_view->editStrokeGradient == 6)
+					{
+						QPair<int, int> selP = selectedMeshPoints[0];
+						currItem->meshGradientArray[selP.first][selP.second].controlColor = currItem->meshGradientArray[selP.first][selP.second].gridPoint;
+						doUpdate = true;
+					}
+					else if (m_view->editStrokeGradient == 7)
+					{
+						QPair<int, int> selP = selectedMeshPoints[0];
+						if (m_gradientPoint == useControlT)
+							currItem->meshGradientArray[selP.first][selP.second].controlTop = currItem->meshGradientArray[selP.first][selP.second].gridPoint;
+						else if (m_gradientPoint == useControlB)
+							currItem->meshGradientArray[selP.first][selP.second].controlBottom = currItem->meshGradientArray[selP.first][selP.second].gridPoint;
+						else if (m_gradientPoint == useControlL)
+							currItem->meshGradientArray[selP.first][selP.second].controlLeft = currItem->meshGradientArray[selP.first][selP.second].gridPoint;
+						else if (m_gradientPoint == useControlR)
+							currItem->meshGradientArray[selP.first][selP.second].controlRight = currItem->meshGradientArray[selP.first][selP.second].gridPoint;
+						doUpdate = true;
+					}
+					break;
+			}
+			if (isMoving)
+			{
+				if (m_view->editStrokeGradient == 5)
+				{
+					for (int mo = 0; mo < selectedMeshPoints.count(); mo++)
+					{
+						QPair<int, int> selP = selectedMeshPoints[mo];
+						currItem->meshGradientArray[selP.first][selP.second].moveRel(moveX, moveY);
+					}
+				}
+				else if (m_view->editStrokeGradient == 6)
+				{
+					QPair<int, int> selP = selectedMeshPoints[0];
+					currItem->meshGradientArray[selP.first][selP.second].controlColor += FPoint(moveX, moveY);
+				}
+				else if (m_view->editStrokeGradient == 7)
+				{
+					QPair<int, int> selP = selectedMeshPoints[0];
+					if (m_gradientPoint == useControlT)
+						currItem->meshGradientArray[selP.first][selP.second].controlTop += FPoint(moveX, moveY);
+					else if (m_gradientPoint == useControlB)
+						currItem->meshGradientArray[selP.first][selP.second].controlBottom += FPoint(moveX, moveY);
+					else if (m_gradientPoint == useControlL)
+						currItem->meshGradientArray[selP.first][selP.second].controlLeft += FPoint(moveX, moveY);
+					else if (m_gradientPoint == useControlR)
+						currItem->meshGradientArray[selP.first][selP.second].controlRight += FPoint(moveX, moveY);
+				}
+			}
+			if (doUpdate)
+			{
+				currItem->update();
+				QRectF upRect;
+				upRect = QRectF(QPointF(0, 0), QPointF(currItem->width(), currItem->height())).normalized();
+				upRect.translate(currItem->xPos(), currItem->yPos());
+				m_doc->regionsChanged()->update(upRect.adjusted(-10.0 - currItem->width() / 2.0, -10.0 - currItem->height() / 2.0, 10.0 + currItem->width() / 2.0, 10.0 + currItem->height() / 2.0));
+			}
+		}
+	}
+	m_keyRepeat = false;
 }
 
 void CanvasMode_EditMeshGradient::mouseDoubleClickEvent(QMouseEvent *m)
@@ -411,7 +570,6 @@
 		}
 	}
 }
-
 
 void CanvasMode_EditMeshGradient::mouseMoveEvent(QMouseEvent *m)
 {
@@ -430,7 +588,18 @@
 			npfN = FPoint(nx, ny);
 		PageItem *currItem = m_doc->m_Selection->itemAt(0);
 		FPoint npf = FPoint(npfN.x(), npfN.y(), currItem->xPos(), currItem->yPos(), currItem->rotation(), 1, 1, true);
-		m_canvas->displayXYHUD(m->globalPos(), npf.x(), npf.y());
+		if (m_view->editStrokeGradient == 6)
+		{
+			if (selectedMeshPoints.count() > 0)
+			{
+				QPair<int, int> selP = selectedMeshPoints[0];
+				FPoint cP = currItem->meshGradientArray[selP.first][selP.second].controlColor;
+				FPoint gP = currItem->meshGradientArray[selP.first][selP.second].gridPoint;
+				m_canvas->displayXYHUD(m->globalPos(), cP.x() - gP.x(), cP.y() - gP.y());
+			}
+		}
+		else
+			m_canvas->displayXYHUD(m->globalPos(), npf.x(), npf.y());
 		FPoint npx(Mxp - npfN.x(), Myp - npfN.y(), 0, 0, currItem->rotation(), 1, 1, true);
 		if (selectedMeshPoints.count() > 0)
 		{
@@ -441,6 +610,11 @@
 					QPair<int, int> selP = selectedMeshPoints[mo];
 					currItem->meshGradientArray[selP.first][selP.second].moveRel(-npx.x(), -npx.y());
 				}
+			}
+			else if (m_view->editStrokeGradient == 6)
+			{
+				QPair<int, int> selP = selectedMeshPoints[0];
+				currItem->meshGradientArray[selP.first][selP.second].controlColor -= npx;
 			}
 			else if (m_view->editStrokeGradient == 7)
 			{
@@ -502,7 +676,7 @@
 				meshPoint mp = currItem->meshGradientArray[grow][gcol];
 				QPointF gradientPoint = QPointF(mp.gridPoint.x(), mp.gridPoint.y());
 				gradientPoint = itemMatrix.map(gradientPoint);
-				if (m_canvas->hitsCanvasPoint(m->globalPos(), gradientPoint))
+				if (m_canvas->hitsCanvasPoint(mousePointDoc, gradientPoint))
 				{
 					selPoint.first = grow;
 					selPoint.second = gcol;
@@ -525,7 +699,9 @@
 				meshPoint mp = currItem->meshGradientArray[grow][gcol];
 				QPointF gradientPoint = QPointF(mp.gridPoint.x(), mp.gridPoint.y());
 				gradientPoint = itemMatrix.map(gradientPoint);
-				if (m_canvas->hitsCanvasPoint(m->globalPos(), gradientPoint))
+				QPointF gradientColorPoint = QPointF(mp.controlColor.x(), mp.controlColor.y());
+				gradientColorPoint = itemMatrix.map(gradientColorPoint);
+				if (m_canvas->hitsCanvasPoint(mousePointDoc, gradientPoint) || m_canvas->hitsCanvasPoint(mousePointDoc, gradientColorPoint))
 				{
 					selPoint.first = grow;
 					selPoint.second = gcol;
@@ -552,13 +728,13 @@
 					if (gcol == 0)
 					{
 						gradientPoint = QPointF(mp1.controlRight.x(), mp1.controlRight.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlR;
 							found = true;
 						}
 						gradientPoint = QPointF(mp1.controlBottom.x(), mp1.controlBottom.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlB;
 							found = true;
@@ -567,13 +743,13 @@
 					else if (gcol == currItem->meshGradientArray[grow].count()-1)
 					{
 						gradientPoint = QPointF(mp1.controlLeft.x(), mp1.controlLeft.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlL;
 							found = true;
 						}
 						gradientPoint = QPointF(mp1.controlBottom.x(), mp1.controlBottom.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlB;
 							found = true;
@@ -582,19 +758,19 @@
 					else
 					{
 						gradientPoint = QPointF(mp1.controlLeft.x(), mp1.controlLeft.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlL;
 							found = true;
 						}
 						gradientPoint = QPointF(mp1.controlRight.x(), mp1.controlRight.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlR;
 							found = true;
 						}
 						gradientPoint = QPointF(mp1.controlBottom.x(), mp1.controlBottom.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlB;
 							found = true;
@@ -606,13 +782,13 @@
 					if (gcol == 0)
 					{
 						gradientPoint = QPointF(mp1.controlRight.x(), mp1.controlRight.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlR;
 							found = true;
 						}
 						gradientPoint = QPointF(mp1.controlTop.x(), mp1.controlTop.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlT;
 							found = true;
@@ -621,13 +797,13 @@
 					else if (gcol == currItem->meshGradientArray[grow].count()-1)
 					{
 						gradientPoint = QPointF(mp1.controlTop.x(), mp1.controlTop.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlT;
 							found = true;
 						}
 						gradientPoint = QPointF(mp1.controlLeft.x(), mp1.controlLeft.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlL;
 							found = true;
@@ -636,19 +812,19 @@
 					else
 					{
 						gradientPoint = QPointF(mp1.controlTop.x(), mp1.controlTop.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlT;
 							found = true;
 						}
 						gradientPoint = QPointF(mp1.controlLeft.x(), mp1.controlLeft.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlL;
 							found = true;
 						}
 						gradientPoint = QPointF(mp1.controlRight.x(), mp1.controlRight.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlR;
 							found = true;
@@ -660,19 +836,19 @@
 					if (gcol == 0)
 					{
 						gradientPoint = QPointF(mp1.controlBottom.x(), mp1.controlBottom.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlB;
 							found = true;
 						}
 						gradientPoint = QPointF(mp1.controlTop.x(), mp1.controlTop.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlT;
 							found = true;
 						}
 						gradientPoint = QPointF(mp1.controlRight.x(), mp1.controlRight.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlR;
 							found = true;
@@ -681,19 +857,19 @@
 					else if (gcol == currItem->meshGradientArray[grow].count()-1)
 					{
 						gradientPoint = QPointF(mp1.controlBottom.x(), mp1.controlBottom.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlB;
 							found = true;
 						}
 						gradientPoint = QPointF(mp1.controlTop.x(), mp1.controlTop.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlT;
 							found = true;
 						}
 						gradientPoint = QPointF(mp1.controlLeft.x(), mp1.controlLeft.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlL;
 							found = true;
@@ -702,25 +878,25 @@
 					else
 					{
 						gradientPoint = QPointF(mp1.controlBottom.x(), mp1.controlBottom.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlB;
 							found = true;
 						}
 						gradientPoint = QPointF(mp1.controlTop.x(), mp1.controlTop.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlT;
 							found = true;
 						}
 						gradientPoint = QPointF(mp1.controlLeft.x(), mp1.controlLeft.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlL;
 							found = true;
 						}
 						gradientPoint = QPointF(mp1.controlRight.x(), mp1.controlRight.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlR;
 							found = true;
@@ -746,7 +922,7 @@
 					meshPoint mp = currItem->meshGradientArray[grow][gcol];
 					QPointF gradientPoint = QPointF(mp.gridPoint.x(), mp.gridPoint.y());
 					gradientPoint = itemMatrix.map(gradientPoint);
-					if (m_canvas->hitsCanvasPoint(m->globalPos(), gradientPoint))
+					if (m_canvas->hitsCanvasPoint(mousePointDoc, gradientPoint))
 					{
 						selPoint.first = grow;
 						selPoint.second = gcol;

Modified: trunk/Scribus/scribus/canvasmode_editmeshgradient.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16869&path=/trunk/Scribus/scribus/canvasmode_editmeshgradient.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editmeshgradient.h (original)
+++ trunk/Scribus/scribus/canvasmode_editmeshgradient.h Mon Oct  3 07:47:18 2011
@@ -52,6 +52,8 @@
 	virtual void mouseReleaseEvent(QMouseEvent *m);
 	virtual void mouseMoveEvent(QMouseEvent *m);
 	virtual void mousePressEvent(QMouseEvent *m);
+	virtual void keyPressEvent(QKeyEvent *e);
+	virtual bool handleKeyEvents() { return true; }
 	virtual void drawControls(QPainter* p);
 	void drawControlsMeshGradient(QPainter* pp, PageItem* currItem);
 
@@ -72,6 +74,7 @@
 	ScribusMainWindow* m_ScMW;
 	eMGradientPoint m_gradientPoint;
 	QList<QPair<int, int> > selectedMeshPoints;
+	bool m_keyRepeat;
 };
 
 

Modified: trunk/Scribus/scribus/mesh.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16869&path=/trunk/Scribus/scribus/mesh.cpp
==============================================================================
--- trunk/Scribus/scribus/mesh.cpp (original)
+++ trunk/Scribus/scribus/mesh.cpp Mon Oct  3 07:47:18 2011
@@ -35,6 +35,7 @@
 	controlBottom += FPoint(dx, dy);
 	controlLeft += FPoint(dx, dy);
 	controlRight += FPoint(dx, dy);
+	controlColor += FPoint(dx, dy);
 }
 
 void meshPoint::moveAbs(double x, double y)
@@ -45,6 +46,7 @@
 	controlBottom -= delta;
 	controlLeft -= delta;
 	controlRight -= delta;
+	controlColor -= delta;
 }
 
 void meshPoint::transform(QTransform t)
@@ -55,12 +57,14 @@
 	gr.addPoint(controlBottom);
 	gr.addPoint(controlLeft);
 	gr.addPoint(controlRight);
+	gr.addPoint(controlColor);
 	gr.map(t);
 	gridPoint = gr.point(0);
 	controlTop = gr.point(1);
 	controlBottom = gr.point(2);
 	controlLeft = gr.point(3);
 	controlRight = gr.point(4);
+	controlColor = gr.point(5);
 }
 
 void meshPoint::resetTo(FPoint p)
@@ -70,4 +74,5 @@
 	controlRight = gridPoint;
 	controlTop = gridPoint;
 	controlBottom = gridPoint;
+	controlColor = gridPoint;
 }

Modified: trunk/Scribus/scribus/mesh.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16869&path=/trunk/Scribus/scribus/mesh.h
==============================================================================
--- trunk/Scribus/scribus/mesh.h (original)
+++ trunk/Scribus/scribus/mesh.h Mon Oct  3 07:47:18 2011
@@ -43,6 +43,7 @@
 	FPoint controlBottom;
 	FPoint controlLeft;
 	FPoint controlRight;
+	FPoint controlColor;
 	double transparency;
 	int    shade;
 	QString colorName;

Modified: trunk/Scribus/scribus/pageitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16869&path=/trunk/Scribus/scribus/pageitem.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem.cpp (original)
+++ trunk/Scribus/scribus/pageitem.cpp Mon Oct  3 07:47:18 2011
@@ -747,69 +747,39 @@
 
 	QList<meshPoint> mgList;
 	meshPoint mgP;
-	mgP.gridPoint = FPoint(0.0, 0.0);
-	mgP.controlTop = mgP.gridPoint;
-	mgP.controlBottom = mgP.gridPoint;
-	mgP.controlLeft = mgP.gridPoint;
-	mgP.controlRight = mgP.gridPoint;
+	meshGradientPatch patch;
+	mgP.resetTo(FPoint(0.0, 0.0));
 	mgP.transparency = 1.0;
 	mgP.shade = 100;
 	mgP.colorName = "Black";
 	mgP.color = qcol;
 	mgList.append(mgP);
-	mgP.gridPoint = FPoint(Width / 2.0, 0.0);
-	mgP.controlTop = mgP.gridPoint;
-	mgP.controlBottom = mgP.gridPoint;
-	mgP.controlLeft = mgP.gridPoint;
-	mgP.controlRight = mgP.gridPoint;
+	patch.TL = mgP;
+	mgP.resetTo(FPoint(Width / 2.0, 0.0));
 	mgList.append(mgP);
-	mgP.gridPoint = FPoint(Width, 0.0);
-	mgP.controlTop = mgP.gridPoint;
-	mgP.controlBottom = mgP.gridPoint;
-	mgP.controlLeft = mgP.gridPoint;
-	mgP.controlRight = mgP.gridPoint;
+	mgP.resetTo(FPoint(Width, 0.0));
+	mgList.append(mgP);
+	patch.TR = mgP;
+	meshGradientArray.append(mgList);
+	mgList.clear();
+	mgP.resetTo(FPoint(0.0, Height / 2.0));
+	mgList.append(mgP);
+	mgP.resetTo(FPoint(Width / 2.0, Height / 2.0));
+	mgList.append(mgP);
+	mgP.resetTo(FPoint(Width, Height / 2.0));
 	mgList.append(mgP);
 	meshGradientArray.append(mgList);
 	mgList.clear();
-	mgP.gridPoint = FPoint(0.0, Height / 2.0);
-	mgP.controlTop = mgP.gridPoint;
-	mgP.controlBottom = mgP.gridPoint;
-	mgP.controlLeft = mgP.gridPoint;
-	mgP.controlRight = mgP.gridPoint;
+	mgP.resetTo(FPoint(0.0, Height));
 	mgList.append(mgP);
-	mgP.gridPoint = FPoint(Width / 2.0, Height / 2.0);
-	mgP.controlTop = mgP.gridPoint;
-	mgP.controlBottom = mgP.gridPoint;
-	mgP.controlLeft = mgP.gridPoint;
-	mgP.controlRight = mgP.gridPoint;
+	patch.BL = mgP;
+	mgP.resetTo(FPoint(Width / 2.0, Height));
 	mgList.append(mgP);
-	mgP.gridPoint = FPoint(Width, Height / 2.0);
-	mgP.controlTop = mgP.gridPoint;
-	mgP.controlBottom = mgP.gridPoint;
-	mgP.controlLeft = mgP.gridPoint;
-	mgP.controlRight = mgP.gridPoint;
+	mgP.resetTo(FPoint(Width, Height));
 	mgList.append(mgP);
+	patch.BR = mgP;
 	meshGradientArray.append(mgList);
-	mgList.clear();
-	mgP.gridPoint = FPoint(0.0, Height);
-	mgP.controlTop = mgP.gridPoint;
-	mgP.controlBottom = mgP.gridPoint;
-	mgP.controlLeft = mgP.gridPoint;
-	mgP.controlRight = mgP.gridPoint;
-	mgList.append(mgP);
-	mgP.gridPoint = FPoint(Width / 2.0, Height);
-	mgP.controlTop = mgP.gridPoint;
-	mgP.controlBottom = mgP.gridPoint;
-	mgP.controlLeft = mgP.gridPoint;
-	mgP.controlRight = mgP.gridPoint;
-	mgList.append(mgP);
-	mgP.gridPoint = FPoint(Width, Height);
-	mgP.controlTop = mgP.gridPoint;
-	mgP.controlBottom = mgP.gridPoint;
-	mgP.controlLeft = mgP.gridPoint;
-	mgP.controlRight = mgP.gridPoint;
-	mgList.append(mgP);
-	meshGradientArray.append(mgList);
+	meshGradientPatches.append(patch);
 
 	firstLineOffsetP = FLOPRealGlyphHeight;
 	Cols = m_Doc->itemToolPrefs().textColumns;
@@ -2846,7 +2816,7 @@
 	col4 = GrColorP4;
 }
 
-void PageItem::setMeshPointColor(int x, int y, QString color, int shade, double transparency)
+void PageItem::setMeshPointColor(int x, int y, QString color, int shade, double transparency, bool forPatch)
 {
 	QString MColor = color;
 	QColor MQColor;
@@ -2887,12 +2857,48 @@
 		VisionDefectColor defect;
 		MQColor = defect.convertDefect(MQColor, m_Doc->previewVisual);
 	}
-	if ((x > -1) && (y > -1))
-	{
-		meshGradientArray[x][y].colorName = MColor;
-		meshGradientArray[x][y].color = MQColor;
-		meshGradientArray[x][y].shade = shade;
-		meshGradientArray[x][y].transparency = transparency;
+	if (forPatch)
+	{
+		meshGradientPatch patch = meshGradientPatches[x];
+		meshPoint mp;
+		switch (y)
+		{
+			case 1:
+				meshGradientPatches[x].TL.colorName = MColor;
+				meshGradientPatches[x].TL.color = MQColor;
+				meshGradientPatches[x].TL.shade = shade;
+				meshGradientPatches[x].TL.transparency = transparency;
+				break;
+			case 2:
+				meshGradientPatches[x].TR.colorName = MColor;
+				meshGradientPatches[x].TR.color = MQColor;
+				meshGradientPatches[x].TR.shade = shade;
+				meshGradientPatches[x].TR.transparency = transparency;
+				break;
+			case 3:
+				meshGradientPatches[x].BR.colorName = MColor;
+				meshGradientPatches[x].BR.color = MQColor;
+				meshGradientPatches[x].BR.shade = shade;
+				meshGradientPatches[x].BR.transparency = transparency;
+				break;
+			case 4:
+				meshGradientPatches[x].BL.colorName = MColor;
+				meshGradientPatches[x].BL.color = MQColor;
+				meshGradientPatches[x].BL.shade = shade;
+				meshGradientPatches[x].BL.transparency = transparency;
+				break;
+		}
+
+	}
+	else
+	{
+		if ((x > -1) && (y > -1))
+		{
+			meshGradientArray[x][y].colorName = MColor;
+			meshGradientArray[x][y].color = MQColor;
+			meshGradientArray[x][y].shade = shade;
+			meshGradientArray[x][y].transparency = transparency;
+		}
 	}
 }
 
@@ -2951,6 +2957,7 @@
 			mgP.controlBottom = mgP.gridPoint;
 			mgP.controlLeft = mgP.gridPoint;
 			mgP.controlRight = mgP.gridPoint;
+			mgP.controlColor = mgP.gridPoint;
 			mgP.transparency = 1.0;
 			mgP.shade = 100;
 			mgP.colorName = MColor;
@@ -2976,6 +2983,7 @@
 			meshGradientArray[x][y].controlBottom = meshGradientArray[x][y].gridPoint;
 			meshGradientArray[x][y].controlLeft = meshGradientArray[x][y].gridPoint;
 			meshGradientArray[x][y].controlRight = meshGradientArray[x][y].gridPoint;
+			meshGradientArray[x][y].controlColor = meshGradientArray[x][y].gridPoint;
 		}
 	}
 }

Modified: trunk/Scribus/scribus/pageitem.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16869&path=/trunk/Scribus/scribus/pageitem.h
==============================================================================
--- trunk/Scribus/scribus/pageitem.h (original)
+++ trunk/Scribus/scribus/pageitem.h Mon Oct  3 07:47:18 2011
@@ -666,7 +666,7 @@
 	void setDiamondGeometry(FPoint c1, FPoint c2, FPoint c3, FPoint c4, FPoint c5);
 	void get4ColorTransparency(double &t1, double &t2, double &t3, double &t4);
 	void get4ColorColors(QString &col1, QString &col2, QString &col3, QString &col4);
-	void setMeshPointColor(int x, int y, QString color, int shade, double transparency);
+	void setMeshPointColor(int x, int y, QString color, int shade, double transparency, bool forPatch = false);
 	void createGradientMesh(int rows, int cols);
 	void resetGradientMesh();
 	void meshToShape();

Modified: trunk/Scribus/scribus/pdflib_core.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16869&path=/trunk/Scribus/scribus/pdflib_core.cpp
==============================================================================
--- trunk/Scribus/scribus/pdflib_core.cpp (original)
+++ trunk/Scribus/scribus/pdflib_core.cpp Mon Oct  3 07:47:18 2011
@@ -6557,7 +6557,7 @@
 		uint shadeObjectT = newObject();
 		StartObj(shadeObjectT);
 		PutDoc("<<\n");
-		PutDoc("/ShadingType 6\n");
+		PutDoc("/ShadingType 7\n");
 		PutDoc("/ColorSpace /DeviceGray\n");
 		PutDoc("/BitsPerCoordinate 32\n");
 		PutDoc("/BitsPerComponent 16\n");
@@ -6583,6 +6583,10 @@
 				vst << encode32dVal(mp1.gridPoint.x()) << encode32dVal(-mp1.gridPoint.y()) << encode32dVal(mp1.controlRight.x()) << encode32dVal(-mp1.controlRight.y()) << encode32dVal(mp2.controlLeft.x()) << encode32dVal(-mp2.controlLeft.y());
 				vst << encode32dVal(mp2.gridPoint.x()) << encode32dVal(-mp2.gridPoint.y()) << encode32dVal(mp2.controlBottom.x()) << encode32dVal(-mp2.controlBottom.y()) << encode32dVal(mp3.controlTop.x()) << encode32dVal(-mp3.controlTop.y());
 				vst << encode32dVal(mp3.gridPoint.x()) << encode32dVal(-mp3.gridPoint.y()) << encode32dVal(mp3.controlLeft.x()) << encode32dVal(-mp3.controlLeft.y()) << encode32dVal(mp4.controlRight.x()) << encode32dVal(-mp4.controlRight.y());
+				vst << encode32dVal(mp4.controlColor.x()) << encode32dVal(-mp4.controlColor.y());
+				vst << encode32dVal(mp1.controlColor.x()) << encode32dVal(-mp1.controlColor.y());
+				vst << encode32dVal(mp2.controlColor.x()) << encode32dVal(-mp2.controlColor.y());
+				vst << encode32dVal(mp3.controlColor.x()) << encode32dVal(-mp3.controlColor.y());
 				vst << encode16dVal(TransVec[colInd4]) << encode16dVal(TransVec[colInd1]) << encode16dVal(TransVec[colInd2]) << encode16dVal(TransVec[colInd3]);
 			}
 		}
@@ -6645,7 +6649,7 @@
 	uint shadeObject = newObject();
 	StartObj(shadeObject);
 	PutDoc("<<\n");
-	PutDoc("/ShadingType 6\n");
+	PutDoc("/ShadingType 7\n");
 	if (Options.UseRGB)
 	{
 		PutDoc("/ColorSpace /DeviceRGB\n");
@@ -6706,6 +6710,10 @@
 			vs << encode32dVal(mp1.gridPoint.x()) << encode32dVal(-mp1.gridPoint.y()) << encode32dVal(mp1.controlRight.x()) << encode32dVal(-mp1.controlRight.y()) << encode32dVal(mp2.controlLeft.x()) << encode32dVal(-mp2.controlLeft.y());
 			vs << encode32dVal(mp2.gridPoint.x()) << encode32dVal(-mp2.gridPoint.y()) << encode32dVal(mp2.controlBottom.x()) << encode32dVal(-mp2.controlBottom.y()) << encode32dVal(mp3.controlTop.x()) << encode32dVal(-mp3.controlTop.y());
 			vs << encode32dVal(mp3.gridPoint.x()) << encode32dVal(-mp3.gridPoint.y()) << encode32dVal(mp3.controlLeft.x()) << encode32dVal(-mp3.controlLeft.y()) << encode32dVal(mp4.controlRight.x()) << encode32dVal(-mp4.controlRight.y());
+			vs << encode32dVal(mp4.controlColor.x()) << encode32dVal(-mp4.controlColor.y());
+			vs << encode32dVal(mp1.controlColor.x()) << encode32dVal(-mp1.controlColor.y());
+			vs << encode32dVal(mp2.controlColor.x()) << encode32dVal(-mp2.controlColor.y());
+			vs << encode32dVal(mp3.controlColor.x()) << encode32dVal(-mp3.controlColor.y());
 			encodeColor(vs, colorNames[colInd4], colorShades[colInd4], spotColorSet, spotMode);
 			encodeColor(vs, colorNames[colInd1], colorShades[colInd1], spotColorSet, spotMode);
 			encodeColor(vs, colorNames[colInd2], colorShades[colInd2], spotColorSet, spotMode);
@@ -6874,7 +6882,7 @@
 		uint shadeObjectT = newObject();
 		StartObj(shadeObjectT);
 		PutDoc("<<\n");
-		PutDoc("/ShadingType 6\n");
+		PutDoc("/ShadingType 7\n");
 		PutDoc("/ColorSpace /DeviceGray\n");
 		PutDoc("/BitsPerCoordinate 32\n");
 		PutDoc("/BitsPerComponent 16\n");
@@ -6899,6 +6907,10 @@
 			vst << encode32dVal(mp1.gridPoint.x()) << encode32dVal(-mp1.gridPoint.y()) << encode32dVal(mp1.controlRight.x()) << encode32dVal(-mp1.controlRight.y()) << encode32dVal(mp2.controlLeft.x()) << encode32dVal(-mp2.controlLeft.y());
 			vst << encode32dVal(mp2.gridPoint.x()) << encode32dVal(-mp2.gridPoint.y()) << encode32dVal(mp2.controlBottom.x()) << encode32dVal(-mp2.controlBottom.y()) << encode32dVal(mp3.controlTop.x()) << encode32dVal(-mp3.controlTop.y());
 			vst << encode32dVal(mp3.gridPoint.x()) << encode32dVal(-mp3.gridPoint.y()) << encode32dVal(mp3.controlLeft.x()) << encode32dVal(-mp3.controlLeft.y()) << encode32dVal(mp4.controlRight.x()) << encode32dVal(-mp4.controlRight.y());
+			vst << encode32dVal(mp4.controlColor.x()) << encode32dVal(-mp4.controlColor.y());
+			vst << encode32dVal(mp1.controlColor.x()) << encode32dVal(-mp1.controlColor.y());
+			vst << encode32dVal(mp2.controlColor.x()) << encode32dVal(-mp2.controlColor.y());
+			vst << encode32dVal(mp3.controlColor.x()) << encode32dVal(-mp3.controlColor.y());
 			vst << encode16dVal(TransVec[colInd4]) << encode16dVal(TransVec[colInd1]) << encode16dVal(TransVec[colInd2]) << encode16dVal(TransVec[colInd3]);
 		}
 		PutDoc("/Decode [-40000 40000 -40000 40000 0 1]\n");
@@ -6960,7 +6972,7 @@
 	uint shadeObject = newObject();
 	StartObj(shadeObject);
 	PutDoc("<<\n");
-	PutDoc("/ShadingType 6\n");
+	PutDoc("/ShadingType 7\n");
 	if (Options.UseRGB)
 	{
 		PutDoc("/ColorSpace /DeviceRGB\n");
@@ -7020,6 +7032,10 @@
 		vs << encode32dVal(mp1.gridPoint.x()) << encode32dVal(-mp1.gridPoint.y()) << encode32dVal(mp1.controlRight.x()) << encode32dVal(-mp1.controlRight.y()) << encode32dVal(mp2.controlLeft.x()) << encode32dVal(-mp2.controlLeft.y());
 		vs << encode32dVal(mp2.gridPoint.x()) << encode32dVal(-mp2.gridPoint.y()) << encode32dVal(mp2.controlBottom.x()) << encode32dVal(-mp2.controlBottom.y()) << encode32dVal(mp3.controlTop.x()) << encode32dVal(-mp3.controlTop.y());
 		vs << encode32dVal(mp3.gridPoint.x()) << encode32dVal(-mp3.gridPoint.y()) << encode32dVal(mp3.controlLeft.x()) << encode32dVal(-mp3.controlLeft.y()) << encode32dVal(mp4.controlRight.x()) << encode32dVal(-mp4.controlRight.y());
+		vs << encode32dVal(mp4.controlColor.x()) << encode32dVal(-mp4.controlColor.y());
+		vs << encode32dVal(mp1.controlColor.x()) << encode32dVal(-mp1.controlColor.y());
+		vs << encode32dVal(mp2.controlColor.x()) << encode32dVal(-mp2.controlColor.y());
+		vs << encode32dVal(mp3.controlColor.x()) << encode32dVal(-mp3.controlColor.y());
 		encodeColor(vs, colorNames[colInd4], colorShades[colInd4], spotColorSet, spotMode);
 		encodeColor(vs, colorNames[colInd1], colorShades[colInd1], spotColorSet, spotMode);
 		encodeColor(vs, colorNames[colInd2], colorShades[colInd2], spotColorSet, spotMode);

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16869&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 Mon Oct  3 07:47:18 2011
@@ -2702,6 +2702,7 @@
 			mp.controlBottom = FPoint(tAtt.valueAsDouble("CBX", 0.0), tAtt.valueAsDouble("CBY", 0.0));
 			mp.controlLeft   = FPoint(tAtt.valueAsDouble("CLX", 0.0), tAtt.valueAsDouble("CLY", 0.0));
 			mp.controlRight  = FPoint(tAtt.valueAsDouble("CRX", 0.0), tAtt.valueAsDouble("CRY", 0.0));
+			mp.controlColor  = FPoint(tAtt.valueAsDouble("CCX", mp.gridPoint.x()), tAtt.valueAsDouble("CCY", mp.gridPoint.y()));
 			mp.color         = SetColor(doc, mp.colorName, mp.shade);
 			mp.color.setAlphaF(mp.transparency);
 			newItem->meshGradientArray[mGArrayRows][mGArrayCols] = mp;
@@ -2723,6 +2724,7 @@
 			mp.controlBottom = FPoint(tAtt.valueAsDouble("CBX", 0.0), tAtt.valueAsDouble("CBY", 0.0));
 			mp.controlLeft   = FPoint(tAtt.valueAsDouble("CLX", 0.0), tAtt.valueAsDouble("CLY", 0.0));
 			mp.controlRight  = FPoint(tAtt.valueAsDouble("CRX", 0.0), tAtt.valueAsDouble("CRY", 0.0));
+			mp.controlColor  = FPoint(tAtt.valueAsDouble("CCX", mp.gridPoint.x()), tAtt.valueAsDouble("CCY", mp.gridPoint.y()));
 			mp.color         = SetColor(doc, mp.colorName, mp.shade);
 			mp.color.setAlphaF(mp.transparency);
 			if (mGArrayCols == 0)

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16869&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 Mon Oct  3 07:47:18 2011
@@ -1618,6 +1618,8 @@
 					docu.writeAttribute("CLY", mp.controlLeft.y());
 					docu.writeAttribute("CRX", mp.controlRight.x());
 					docu.writeAttribute("CRY", mp.controlRight.y());
+					docu.writeAttribute("CCX", mp.controlColor.x());
+					docu.writeAttribute("CCY", mp.controlColor.y());
 					docu.writeAttribute("NAME", mp.colorName);
 					docu.writeAttribute("SHADE", mp.shade);
 					docu.writeAttribute("TRANS", mp.transparency);
@@ -1652,6 +1654,8 @@
 					docu.writeAttribute("CLY", mp.controlLeft.y());
 					docu.writeAttribute("CRX", mp.controlRight.x());
 					docu.writeAttribute("CRY", mp.controlRight.y());
+					docu.writeAttribute("CCX", mp.controlColor.x());
+					docu.writeAttribute("CCY", mp.controlColor.y());
 					docu.writeAttribute("NAME", mp.colorName);
 					docu.writeAttribute("SHADE", mp.shade);
 					docu.writeAttribute("TRANS", mp.transparency);

Modified: trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16869&path=/trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp Mon Oct  3 07:47:18 2011
@@ -781,6 +781,7 @@
 		applyMask(ite);
 	}
 //	qDebug() << "Mesh of" << shading->getNPatches() << "Patches";
+	ite->meshGradientPatches.clear();
 	for (int i = 0; i < shading->getNPatches(); i++)
 	{
 		GfxPatch *patch = shading->getPatch(i);
@@ -790,6 +791,7 @@
 		patchM.BL.resetTo(FPoint(patch->x[0][0], patch->y[0][0]));
 		patchM.BL.controlTop = FPoint(patch->x[0][1], patch->y[0][1]);
 		patchM.BL.controlRight = FPoint(patch->x[1][0], patch->y[1][0]);
+		patchM.BL.controlColor = FPoint(patch->x[1][1], patch->y[1][1]);
 		u = 0;
 		v = 0;
 		if (shading->isParameterized())
@@ -813,6 +815,7 @@
 		patchM.TL.resetTo(FPoint(patch->x[0][3], patch->y[0][3]));
 		patchM.TL.controlRight = FPoint(patch->x[1][3], patch->y[1][3]);
 		patchM.TL.controlBottom = FPoint(patch->x[0][2], patch->y[0][2]);
+		patchM.TL.controlColor = FPoint(patch->x[1][2], patch->y[1][2]);
 		if (shading->isParameterized())
 		{
 			shading->getParameterizedColor (patch->color[u][v].c[0], &color);
@@ -834,6 +837,7 @@
 		patchM.TR.resetTo(FPoint(patch->x[3][3], patch->y[3][3]));
 		patchM.TR.controlBottom = FPoint(patch->x[3][2], patch->y[3][2]);
 		patchM.TR.controlLeft = FPoint(patch->x[2][3], patch->y[2][3]);
+		patchM.TR.controlColor = FPoint(patch->x[2][2], patch->y[2][2]);
 		if (shading->isParameterized())
 		{
 			shading->getParameterizedColor (patch->color[u][v].c[0], &color);
@@ -855,6 +859,7 @@
 		patchM.BR.resetTo(FPoint(patch->x[3][0], patch->y[3][0]));
 		patchM.BR.controlLeft = FPoint(patch->x[2][0], patch->y[2][0]);
 		patchM.BR.controlTop = FPoint(patch->x[3][1], patch->y[3][1]);
+		patchM.BR.controlColor = FPoint(patch->x[2][1], patch->y[2][1]);
 		if (shading->isParameterized())
 		{
 			shading->getParameterizedColor (patch->color[u][v].c[0], &color);

Modified: trunk/Scribus/scribus/pslib.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16869&path=/trunk/Scribus/scribus/pslib.cpp
==============================================================================
--- trunk/Scribus/scribus/pslib.cpp (original)
+++ trunk/Scribus/scribus/pslib.cpp Mon Oct  3 07:47:18 2011
@@ -3175,6 +3175,7 @@
 	QStringList colorValues;
 	QStringList spotColorSet;
 	QStringList tmpAddedColors;
+	QString entx = "";
 	tmpAddedColors.clear();
 	QList<int> colsSh;
 	for (int grow = 0; grow < c->meshGradientArray.count(); grow++)
@@ -3250,15 +3251,19 @@
 	PutStream("/PatternType 2\n");
 	PutStream("/Shading\n");
 	PutStream("<<\n");
-	PutStream("/ShadingType 6\n");
+        PutStream("/ShadingType 7\n");
 	if ((DoSep) || (GraySc))
+	{
 		PutStream("/ColorSpace /DeviceGray\n");
+		entx = "0 1";
+	}
 	else if ((useSpotColors) && ((spotColorSet.count() > 0) && (spotColorSet.count() < 28)))
 	{
 		PutStream("/ColorSpace [ /DeviceN [/Cyan /Magenta /Yellow /Black");
 		for (int sc = 0; sc < spotColorSet.count(); sc++)
 		{
 			PutStream(" ("+spotColorSet.at(sc)+")");
+			entx += " 0 1";
 		}
 		PutStream("]\n");
 		PutStream("/DeviceCMYK\n");
@@ -3288,8 +3293,22 @@
 		PutStream("} ]\n");
 	}
 	else
+	{
 		PutStream("/ColorSpace /DeviceCMYK\n");
-	PutStream("/DataSource [\n");
+		entx = "0 1 0 1 0 1 0 1";
+	}
+	PutStream("/BitsPerCoordinate 32\n");
+	PutStream("/BitsPerComponent 16\n");
+	PutStream("/BitsPerFlag 8\n");
+	PutStream("/Decode [-40000 40000 -40000 40000 "+entx+"]\n");
+	PutStream("/DataSource currentfile /ASCII85Decode filter /FlateDecode filter\n");
+	PutStream(">>\n");
+	PutStream(">>\n");
+	PutStream("[1 0 0 1 0 0] makepattern\n");
+	QByteArray vertStream;
+	QDataStream vst(&vertStream, QIODevice::WriteOnly);
+	vst.setByteOrder(QDataStream::BigEndian);
+	quint8 flg = 0;
 	for (int grow = 0; grow < c->meshGradientArray.count()-1; grow++)
 	{
 		for (int gcol = 0; gcol < c->meshGradientArray[grow].count()-1; gcol++)
@@ -3302,18 +3321,23 @@
 			int colInd2 = grow * c->meshGradientArray[grow].count() + gcol + 1;
 			int colInd3 = (grow + 1) * c->meshGradientArray[grow].count() + gcol + 1;
 			int colInd4 = (grow + 1) * c->meshGradientArray[grow].count() + gcol;
-			PutStream("0\n");
-			PutStream(ToStr(mp4.gridPoint.x())+" "+ToStr(-mp4.gridPoint.y())+" "+ToStr(mp4.controlTop.x())+" "+ToStr(-mp4.controlTop.y())+" "+ToStr(mp1.controlBottom.x())+" "+ToStr(-mp1.controlBottom.y())+"\n");
-			PutStream(ToStr(mp1.gridPoint.x())+" "+ToStr(-mp1.gridPoint.y())+" "+ToStr(mp1.controlRight.x())+" "+ToStr(-mp1.controlRight.y())+" "+ToStr(mp2.controlLeft.x())+" "+ToStr(-mp2.controlLeft.y())+"\n");
-			PutStream(ToStr(mp2.gridPoint.x())+" "+ToStr(-mp2.gridPoint.y())+" "+ToStr(mp2.controlBottom.x())+" "+ToStr(-mp2.controlBottom.y())+" "+ToStr(mp3.controlTop.x())+" "+ToStr(-mp3.controlTop.y())+"\n");
-			PutStream(ToStr(mp3.gridPoint.x())+" "+ToStr(-mp3.gridPoint.y())+" "+ToStr(mp3.controlLeft.x())+" "+ToStr(-mp3.controlLeft.y())+" "+ToStr(mp4.controlRight.x())+" "+ToStr(-mp4.controlRight.y())+"\n");
-			PutStream(colorValues[colInd4]+" "+colorValues[colInd1]+" "+colorValues[colInd2]+" "+colorValues[colInd3]+"\n");
-		}
-	}
-	PutStream("]\n");
-	PutStream(">>\n");
-	PutStream(">>\n");
-	PutStream("[1 0 0 1 0 0] makepattern setpattern\n");
+			vst << flg;
+			vst << encode32dVal(mp4.gridPoint.x()) << encode32dVal(-mp4.gridPoint.y()) << encode32dVal(mp4.controlTop.x()) << encode32dVal(-mp4.controlTop.y()) << encode32dVal(mp1.controlBottom.x()) << encode32dVal(-mp1.controlBottom.y());
+			vst << encode32dVal(mp1.gridPoint.x()) << encode32dVal(-mp1.gridPoint.y()) << encode32dVal(mp1.controlRight.x()) << encode32dVal(-mp1.controlRight.y()) << encode32dVal(mp2.controlLeft.x()) << encode32dVal(-mp2.controlLeft.y());
+			vst << encode32dVal(mp2.gridPoint.x()) << encode32dVal(-mp2.gridPoint.y()) << encode32dVal(mp2.controlBottom.x()) << encode32dVal(-mp2.controlBottom.y()) << encode32dVal(mp3.controlTop.x()) << encode32dVal(-mp3.controlTop.y());
+			vst << encode32dVal(mp3.gridPoint.x()) << encode32dVal(-mp3.gridPoint.y()) << encode32dVal(mp3.controlLeft.x()) << encode32dVal(-mp3.controlLeft.y()) << encode32dVal(mp4.controlRight.x()) << encode32dVal(-mp4.controlRight.y());
+			vst << encode32dVal(mp4.controlColor.x()) << encode32dVal(-mp4.controlColor.y());
+			vst << encode32dVal(mp1.controlColor.x()) << encode32dVal(-mp1.controlColor.y());
+			vst << encode32dVal(mp2.controlColor.x()) << encode32dVal(-mp2.controlColor.y());
+			vst << encode32dVal(mp3.controlColor.x()) << encode32dVal(-mp3.controlColor.y());
+			encodeColor(vst, colorValues[colInd4]);
+			encodeColor(vst, colorValues[colInd1]);
+			encodeColor(vst, colorValues[colInd2]);
+			encodeColor(vst, colorValues[colInd3]);
+		}
+	}
+	PutImageDataToStream(vertStream);
+	PutStream("setpattern\n");
 	if (fillRule)
 		PutStream("eofill\n");
 	else
@@ -3337,6 +3361,7 @@
 	QStringList colorValues;
 	QStringList spotColorSet;
 	QList<int> colsSh;
+	QString entx = "";
 	for (int col = 0; col < c->meshGradientPatches.count(); col++)
 	{
 		meshGradientPatch patch = c->meshGradientPatches[col];
@@ -3420,15 +3445,20 @@
 	PutStream("/PatternType 2\n");
 	PutStream("/Shading\n");
 	PutStream("<<\n");
-	PutStream("/ShadingType 6\n");
+	PutStream("/ShadingType 7\n");
 	if ((DoSep) || (GraySc))
+	{
 		PutStream("/ColorSpace /DeviceGray\n");
+		entx = "0 1";
+	}
 	else if ((useSpotColors) && ((spotColorSet.count() > 0) && (spotColorSet.count() < 28)))
 	{
+		entx = "0 1 0 1 0 1 0 1";
 		PutStream("/ColorSpace [ /DeviceN [/Cyan /Magenta /Yellow /Black");
 		for (int sc = 0; sc < spotColorSet.count(); sc++)
 		{
 			PutStream(" ("+spotColorSet.at(sc)+")");
+			entx += " 0 1";
 		}
 		PutStream("]\n");
 		PutStream("/DeviceCMYK\n");
@@ -3458,8 +3488,22 @@
 		PutStream("} ]\n");
 	}
 	else
+	{
 		PutStream("/ColorSpace /DeviceCMYK\n");
-	PutStream("/DataSource [\n");
+		entx = "0 1 0 1 0 1 0 1";
+	}
+	PutStream("/BitsPerCoordinate 32\n");
+	PutStream("/BitsPerComponent 16\n");
+	PutStream("/BitsPerFlag 8\n");
+	PutStream("/Decode [-40000 40000 -40000 40000 "+entx+"]\n");
+	PutStream("/DataSource currentfile /ASCII85Decode filter /FlateDecode filter\n");
+	PutStream(">>\n");
+	PutStream(">>\n");
+	PutStream("[1 0 0 1 0 0] makepattern\n");
+	QByteArray vertStream;
+	QDataStream vst(&vertStream, QIODevice::WriteOnly);
+	vst.setByteOrder(QDataStream::BigEndian);
+	quint8 flg = 0;
 	for (int col = 0; col < c->meshGradientPatches.count(); col++)
 	{
 		meshGradientPatch patch = c->meshGradientPatches[col];
@@ -3471,22 +3515,49 @@
 		int colInd2 = 4 * col + 1;
 		int colInd3 = 4 * col + 2;
 		int colInd4 = 4 * col + 3;
-		PutStream("0\n");
-		PutStream(ToStr(mp4.gridPoint.x())+" "+ToStr(-mp4.gridPoint.y())+" "+ToStr(mp4.controlTop.x())+" "+ToStr(-mp4.controlTop.y())+" "+ToStr(mp1.controlBottom.x())+" "+ToStr(-mp1.controlBottom.y())+"\n");
-		PutStream(ToStr(mp1.gridPoint.x())+" "+ToStr(-mp1.gridPoint.y())+" "+ToStr(mp1.controlRight.x())+" "+ToStr(-mp1.controlRight.y())+" "+ToStr(mp2.controlLeft.x())+" "+ToStr(-mp2.controlLeft.y())+"\n");
-		PutStream(ToStr(mp2.gridPoint.x())+" "+ToStr(-mp2.gridPoint.y())+" "+ToStr(mp2.controlBottom.x())+" "+ToStr(-mp2.controlBottom.y())+" "+ToStr(mp3.controlTop.x())+" "+ToStr(-mp3.controlTop.y())+"\n");
-		PutStream(ToStr(mp3.gridPoint.x())+" "+ToStr(-mp3.gridPoint.y())+" "+ToStr(mp3.controlLeft.x())+" "+ToStr(-mp3.controlLeft.y())+" "+ToStr(mp4.controlRight.x())+" "+ToStr(-mp4.controlRight.y())+"\n");
-		PutStream(colorValues[colInd4]+" "+colorValues[colInd1]+" "+colorValues[colInd2]+" "+colorValues[colInd3]+"\n");
-	}
-	PutStream("]\n");
-	PutStream(">>\n");
-	PutStream(">>\n");
-	PutStream("[1 0 0 1 0 0] makepattern setpattern\n");
+		vst << flg;
+		vst << encode32dVal(mp4.gridPoint.x()) << encode32dVal(-mp4.gridPoint.y()) << encode32dVal(mp4.controlTop.x()) << encode32dVal(-mp4.controlTop.y()) << encode32dVal(mp1.controlBottom.x()) << encode32dVal(-mp1.controlBottom.y());
+		vst << encode32dVal(mp1.gridPoint.x()) << encode32dVal(-mp1.gridPoint.y()) << encode32dVal(mp1.controlRight.x()) << encode32dVal(-mp1.controlRight.y()) << encode32dVal(mp2.controlLeft.x()) << encode32dVal(-mp2.controlLeft.y());
+		vst << encode32dVal(mp2.gridPoint.x()) << encode32dVal(-mp2.gridPoint.y()) << encode32dVal(mp2.controlBottom.x()) << encode32dVal(-mp2.controlBottom.y()) << encode32dVal(mp3.controlTop.x()) << encode32dVal(-mp3.controlTop.y());
+		vst << encode32dVal(mp3.gridPoint.x()) << encode32dVal(-mp3.gridPoint.y()) << encode32dVal(mp3.controlLeft.x()) << encode32dVal(-mp3.controlLeft.y()) << encode32dVal(mp4.controlRight.x()) << encode32dVal(-mp4.controlRight.y());
+		vst << encode32dVal(mp4.controlColor.x()) << encode32dVal(-mp4.controlColor.y());
+		vst << encode32dVal(mp1.controlColor.x()) << encode32dVal(-mp1.controlColor.y());
+		vst << encode32dVal(mp2.controlColor.x()) << encode32dVal(-mp2.controlColor.y());
+		vst << encode32dVal(mp3.controlColor.x()) << encode32dVal(-mp3.controlColor.y());
+		encodeColor(vst, colorValues[colInd4]);
+		encodeColor(vst, colorValues[colInd1]);
+		encodeColor(vst, colorValues[colInd2]);
+		encodeColor(vst, colorValues[colInd3]);
+	}
+	PutImageDataToStream(vertStream);
+	PutStream("setpattern\n");
 	if (fillRule)
 		PutStream("eofill\n");
 	else
 		PutStream("fill\n");
 	return;
+}
+
+
+quint32 PSLib::encode32dVal(double val)
+{
+	quint32 res = static_cast<quint32>(((val - (-40000.0)) / 80000.0) * 0xFFFFFFFF);
+	return res;
+}
+
+quint16 PSLib::encode16dVal(double val)
+{
+	quint16 m = val * 0xFFFF;
+	return m;
+}
+
+void PSLib::encodeColor(QDataStream &vs, QString col)
+{
+	QStringList gcol = col.split(" ");
+	for (int gcs = 0; gcs < gcol.count(); gcs++)
+	{
+		vs << encode16dVal(gcol[gcs].toDouble());
+	}
 }
 
 void PSLib::HandleDiamondGradient(PageItem* c, bool gcr)

Modified: trunk/Scribus/scribus/pslib.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16869&path=/trunk/Scribus/scribus/pslib.h
==============================================================================
--- trunk/Scribus/scribus/pslib.h (original)
+++ trunk/Scribus/scribus/pslib.h Mon Oct  3 07:47:18 2011
@@ -158,6 +158,10 @@
 		void WriteASCII85Bytes(const QByteArray& array);
 		void WriteASCII85Bytes(const unsigned char* array, int length);
 
+		quint32 encode32dVal(double val);
+		quint16 encode16dVal(double val);
+		void encodeColor(QDataStream &vs, QString col);
+
 		Optimization optimization;
 
 		QString ToStr(double c);

Modified: trunk/Scribus/scribus/scpainter.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16869&path=/trunk/Scribus/scribus/scpainter.cpp
==============================================================================
--- trunk/Scribus/scribus/scpainter.cpp (original)
+++ trunk/Scribus/scribus/scpainter.cpp Mon Oct  3 07:47:18 2011
@@ -1272,6 +1272,10 @@
 						cairo_pattern_mesh_curve_to(mpat, mp2.controlBottom.x(), mp2.controlBottom.y(), mp3.controlTop.x(), mp3.controlTop.y(), mp3.gridPoint.x(), mp3.gridPoint.y());
 						cairo_pattern_mesh_curve_to(mpat, mp3.controlLeft.x(), mp3.controlLeft.y(), mp4.controlRight.x(), mp4.controlRight.y(), mp4.gridPoint.x(), mp4.gridPoint.y());
 						cairo_pattern_mesh_curve_to(mpat, mp4.controlTop.x(), mp4.controlTop.y(), mp1.controlBottom.x(), mp1.controlBottom.y(), mp1.gridPoint.x(), mp1.gridPoint.y());
+						cairo_pattern_mesh_set_control_point(mpat, 0, mp1.controlColor.x(),  mp1.controlColor.y());
+						cairo_pattern_mesh_set_control_point(mpat, 1, mp2.controlColor.x(),  mp2.controlColor.y());
+						cairo_pattern_mesh_set_control_point(mpat, 2, mp3.controlColor.x(),  mp3.controlColor.y());
+						cairo_pattern_mesh_set_control_point(mpat, 3, mp4.controlColor.x(),  mp4.controlColor.y());
 						mp1.color.getRgbF(&r, &g, &b, &a);
 						cairo_pattern_mesh_set_corner_color_rgba(mpat, 0, r, g, b, a);
 						mp2.color.getRgbF(&r, &g, &b, &a);
@@ -1372,6 +1376,10 @@
 					cairo_pattern_mesh_curve_to(mpat, mp2.controlBottom.x(), mp2.controlBottom.y(), mp3.controlTop.x(), mp3.controlTop.y(), mp3.gridPoint.x(), mp3.gridPoint.y());
 					cairo_pattern_mesh_curve_to(mpat, mp3.controlLeft.x(), mp3.controlLeft.y(), mp4.controlRight.x(), mp4.controlRight.y(), mp4.gridPoint.x(), mp4.gridPoint.y());
 					cairo_pattern_mesh_curve_to(mpat, mp4.controlTop.x(), mp4.controlTop.y(), mp1.controlBottom.x(), mp1.controlBottom.y(), mp1.gridPoint.x(), mp1.gridPoint.y());
+					cairo_pattern_mesh_set_control_point(mpat, 0, mp1.controlColor.x(),  mp1.controlColor.y());
+					cairo_pattern_mesh_set_control_point(mpat, 1, mp2.controlColor.x(),  mp2.controlColor.y());
+					cairo_pattern_mesh_set_control_point(mpat, 2, mp3.controlColor.x(),  mp3.controlColor.y());
+					cairo_pattern_mesh_set_control_point(mpat, 3, mp4.controlColor.x(),  mp4.controlColor.y());
 					mp1.color.getRgbF(&r, &g, &b, &a);
 					cairo_pattern_mesh_set_corner_color_rgba(mpat, 0, r, g, b, a);
 					mp2.color.getRgbF(&r, &g, &b, &a);

Modified: trunk/Scribus/scribus/scribusstructs.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16869&path=/trunk/Scribus/scribus/scribusstructs.h
==============================================================================
--- trunk/Scribus/scribus/scribusstructs.h (original)
+++ trunk/Scribus/scribus/scribusstructs.h Mon Oct  3 07:47:18 2011
@@ -318,7 +318,8 @@
 	modeEditPolygon,
 	modeDrawSpiral,
 	modeEditSpiral,
-	modeEditTable
+	modeEditTable,
+	modeEditMeshPatch
 };
 
 struct AlignObjs

Modified: trunk/Scribus/scribus/scribusview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16869&path=/trunk/Scribus/scribus/scribusview.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusview.cpp (original)
+++ trunk/Scribus/scribus/scribusview.cpp Mon Oct  3 07:47:18 2011
@@ -2534,7 +2534,15 @@
 	else
 		rememberOldZoomLocation(mx,my);
 	double newScale = m_canvas->scale() * static_cast<double>(Doc->opToolPrefs().magStep)/100.0;
-	zoom(oldX, oldY, newScale, true);
+	if (Doc->m_Selection->count() != 0)
+	{
+		PageItem *currItem = Doc->m_Selection->itemAt(0);
+		double zPointX = currItem->xPos() + currItem->width() / 2.0;
+		double zPointY = currItem->yPos() + currItem->height() / 2.0;
+		zoom( qRound(zPointX), qRound(zPointY), newScale, false);
+	}
+	else
+		zoom(oldX, oldY, newScale, true);
 }
 
 /** Verkleinert die Ansicht */
@@ -2552,7 +2560,15 @@
 	else
 		rememberOldZoomLocation(mx,my);
 	double newScale = m_canvas->scale() / (static_cast<double>(Doc->opToolPrefs().magStep)/100.0);
-	zoom(oldX, oldY, newScale, true);
+	if (Doc->m_Selection->count() != 0)
+	{
+		PageItem *currItem = Doc->m_Selection->itemAt(0);
+		double zPointX = currItem->xPos() + currItem->width() / 2.0;
+		double zPointY = currItem->yPos() + currItem->height() / 2.0;
+		zoom( qRound(zPointX), qRound(zPointY), newScale, false);
+	}
+	else
+		zoom(oldX, oldY, newScale, true);
 }
 
 #if 0

Modified: trunk/Scribus/scribus/scribusview.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16869&path=/trunk/Scribus/scribus/scribusview.h
==============================================================================
--- trunk/Scribus/scribus/scribusview.h (original)
+++ trunk/Scribus/scribus/scribusview.h Mon Oct  3 07:47:18 2011
@@ -101,6 +101,7 @@
 	friend class CanvasMode_Edit;
 	friend class CanvasMode_EditGradient;
 	friend class CanvasMode_EditMeshGradient;
+	friend class CanvasMode_EditMeshPatch;
 	friend class CanvasMode_EditPolygon;
 	friend class CanvasMode_EditArc;
 	friend class CanvasMode_EditSpiral;

Modified: trunk/Scribus/scribus/ui/cpalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16869&path=/trunk/Scribus/scribus/ui/cpalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/cpalette.cpp (original)
+++ trunk/Scribus/scribus/ui/cpalette.cpp Mon Oct  3 07:47:18 2011
@@ -299,7 +299,10 @@
 		strokeModeCombo->setCurrentIndex(1);
 	else
 		strokeModeCombo->setCurrentIndex(0);
-	setMeshPoint();
+	if (currentItem->GrType == 12)
+		setMeshPatchPoint();
+	else
+		setMeshPoint();
 	editMeshColors->setEnabled(!CGradDia->isVisible());
 	gradEditButton->setEnabled(true);
 
@@ -1133,6 +1136,8 @@
 	{
 		if (currentItem->GrType == 11)
 			editStrokeGradient = 6;
+		else if (currentItem->GrType == 12)
+			editStrokeGradient = 8;
 		else
 			editStrokeGradient = 0;
 		gradEditButton->setEnabled(false);
@@ -1177,16 +1182,51 @@
 	int grow = currentItem->selectedMeshPointX;
 	int gcol = currentItem->selectedMeshPointY;
 	int cont = currentItem->selectedMeshControlPoint;
-	if ((grow == -1) || (gcol == -1))
-		return;
-	if (cont == 1)
-		currentItem->meshGradientArray[grow][gcol].controlTop    = currentItem->meshGradientArray[grow][gcol].gridPoint;
-	else if (cont == 2)
-		currentItem->meshGradientArray[grow][gcol].controlBottom = currentItem->meshGradientArray[grow][gcol].gridPoint;
-	else if (cont == 3)
-		currentItem->meshGradientArray[grow][gcol].controlLeft   = currentItem->meshGradientArray[grow][gcol].gridPoint;
-	else if (cont == 4)
-		currentItem->meshGradientArray[grow][gcol].controlRight  = currentItem->meshGradientArray[grow][gcol].gridPoint;
+	if (currentItem->GrType == 12)
+	{
+		if ((grow == -1) || (gcol == 0))
+			return;
+		switch (gcol)
+		{
+			case 1:
+				if (cont == 2)
+					currentItem->meshGradientPatches[grow].TL.controlBottom    = currentItem->meshGradientPatches[grow].TL.gridPoint;
+				if (cont == 4)
+					currentItem->meshGradientPatches[grow].TL.controlRight  = currentItem->meshGradientPatches[grow].TL.gridPoint;
+				break;
+			case 2:
+				if (cont == 2)
+					currentItem->meshGradientPatches[grow].TR.controlBottom = currentItem->meshGradientPatches[grow].TR.gridPoint;
+				if (cont == 3)
+					currentItem->meshGradientPatches[grow].TR.controlLeft   = currentItem->meshGradientPatches[grow].TR.gridPoint;
+				break;
+			case 3:
+				if (cont == 1)
+					currentItem->meshGradientPatches[grow].BR.controlTop    = currentItem->meshGradientPatches[grow].BR.gridPoint;
+				if (cont == 3)
+					currentItem->meshGradientPatches[grow].BR.controlLeft   = currentItem->meshGradientPatches[grow].BR.gridPoint;
+				break;
+			case 4:
+				if (cont == 1)
+					currentItem->meshGradientPatches[grow].BL.controlTop    = currentItem->meshGradientPatches[grow].BL.gridPoint;
+				if (cont == 4)
+					currentItem->meshGradientPatches[grow].BL.controlRight  = currentItem->meshGradientPatches[grow].BL.gridPoint;
+				break;
+		}
+	}
+	else
+	{
+		if ((grow == -1) || (gcol == -1))
+			return;
+		if (cont == 1)
+			currentItem->meshGradientArray[grow][gcol].controlTop    = currentItem->meshGradientArray[grow][gcol].gridPoint;
+		else if (cont == 2)
+			currentItem->meshGradientArray[grow][gcol].controlBottom = currentItem->meshGradientArray[grow][gcol].gridPoint;
+		else if (cont == 3)
+			currentItem->meshGradientArray[grow][gcol].controlLeft   = currentItem->meshGradientArray[grow][gcol].gridPoint;
+		else if (cont == 4)
+			currentItem->meshGradientArray[grow][gcol].controlRight  = currentItem->meshGradientArray[grow][gcol].gridPoint;
+	}
 	currentItem->update();
 	currentDoc->regionsChanged()->update(QRect());
 }
@@ -1195,12 +1235,47 @@
 {
 	int grow = currentItem->selectedMeshPointX;
 	int gcol = currentItem->selectedMeshPointY;
-	if ((grow == -1) || (gcol == -1))
-		return;
-	currentItem->meshGradientArray[grow][gcol].controlTop    = currentItem->meshGradientArray[grow][gcol].gridPoint;
-	currentItem->meshGradientArray[grow][gcol].controlLeft   = currentItem->meshGradientArray[grow][gcol].gridPoint;
-	currentItem->meshGradientArray[grow][gcol].controlRight  = currentItem->meshGradientArray[grow][gcol].gridPoint;
-	currentItem->meshGradientArray[grow][gcol].controlBottom = currentItem->meshGradientArray[grow][gcol].gridPoint;
+	if (currentItem->GrType == 12)
+	{
+		if ((grow == -1) || (gcol == 0))
+			return;
+		switch (gcol)
+		{
+			case 1:
+				currentItem->meshGradientPatches[grow].TL.controlTop    = currentItem->meshGradientPatches[grow].TL.gridPoint;
+				currentItem->meshGradientPatches[grow].TL.controlLeft   = currentItem->meshGradientPatches[grow].TL.gridPoint;
+				currentItem->meshGradientPatches[grow].TL.controlRight  = currentItem->meshGradientPatches[grow].TL.gridPoint;
+				currentItem->meshGradientPatches[grow].TL.controlBottom = currentItem->meshGradientPatches[grow].TL.gridPoint;
+				break;
+			case 2:
+				currentItem->meshGradientPatches[grow].TR.controlTop    = currentItem->meshGradientPatches[grow].TR.gridPoint;
+				currentItem->meshGradientPatches[grow].TR.controlLeft   = currentItem->meshGradientPatches[grow].TR.gridPoint;
+				currentItem->meshGradientPatches[grow].TR.controlRight  = currentItem->meshGradientPatches[grow].TR.gridPoint;
+				currentItem->meshGradientPatches[grow].TR.controlBottom = currentItem->meshGradientPatches[grow].TR.gridPoint;
+				break;
+			case 3:
+				currentItem->meshGradientPatches[grow].BR.controlTop    = currentItem->meshGradientPatches[grow].BR.gridPoint;
+				currentItem->meshGradientPatches[grow].BR.controlLeft   = currentItem->meshGradientPatches[grow].BR.gridPoint;
+				currentItem->meshGradientPatches[grow].BR.controlRight  = currentItem->meshGradientPatches[grow].BR.gridPoint;
+				currentItem->meshGradientPatches[grow].BR.controlBottom = currentItem->meshGradientPatches[grow].BR.gridPoint;
+				break;
+			case 4:
+				currentItem->meshGradientPatches[grow].BL.controlTop    = currentItem->meshGradientPatches[grow].BL.gridPoint;
+				currentItem->meshGradientPatches[grow].BL.controlLeft   = currentItem->meshGradientPatches[grow].BL.gridPoint;
+				currentItem->meshGradientPatches[grow].BL.controlRight  = currentItem->meshGradientPatches[grow].BL.gridPoint;
+				currentItem->meshGradientPatches[grow].BL.controlBottom = currentItem->meshGradientPatches[grow].BL.gridPoint;
+				break;
+		}
+	}
+	else
+	{
+		if ((grow == -1) || (gcol == -1))
+			return;
+		currentItem->meshGradientArray[grow][gcol].controlTop    = currentItem->meshGradientArray[grow][gcol].gridPoint;
+		currentItem->meshGradientArray[grow][gcol].controlLeft   = currentItem->meshGradientArray[grow][gcol].gridPoint;
+		currentItem->meshGradientArray[grow][gcol].controlRight  = currentItem->meshGradientArray[grow][gcol].gridPoint;
+		currentItem->meshGradientArray[grow][gcol].controlBottom = currentItem->meshGradientArray[grow][gcol].gridPoint;
+	}
 	currentItem->update();
 	currentDoc->regionsChanged()->update(QRect());
 }
@@ -1230,6 +1305,11 @@
 			CGradDia->selectMesh();
 			editMeshColors->setEnabled(false);
 		}
+		else if (currentItem->GrType == 12)
+		{
+			CGradDia->selectPatchMesh();
+			editMeshColors->setEnabled(false);
+		}
 		else if (currentItem->GrType == 13)
 			CGradDia->selectConical();
 		CGradDia->show();
@@ -1245,6 +1325,8 @@
 		editStrokeGradient = 4;
 	else if (currentItem->GrType == 11)
 		editStrokeGradient = 5;
+	else if (currentItem->GrType == 12)
+		editStrokeGradient = 9;
 	else
 		editStrokeGradient = 0;
 	emit editGradient(editStrokeGradient);
@@ -1291,7 +1373,7 @@
 
 void Cpalette::setMeshPoint()
 {
-	if ((currentItem->selectedMeshPointX > -1) && (currentItem->selectedMeshPointY > -1l))
+	if ((currentItem->selectedMeshPointX > -1) && (currentItem->selectedMeshPointY > -1))
 	{
 		colorMeshPoint->setEnabled(true);
 		shadeMeshPoint->setEnabled(true);
@@ -1319,8 +1401,44 @@
 	if (color == CommonStrings::tr_NoneColor)
 		color = CommonStrings::None;
 	double t = transparencyMeshPoint->value() / 100.0;
-	currentItem->setMeshPointColor(currentItem->selectedMeshPointX, currentItem->selectedMeshPointY, color, shadeMeshPoint->value(), t);
+	currentItem->setMeshPointColor(currentItem->selectedMeshPointX, currentItem->selectedMeshPointY, color, shadeMeshPoint->value(), t, currentDoc->view()->editStrokeGradient == 8);
 	currentItem->update();
+}
+
+void Cpalette::setMeshPatchPoint()
+{
+	if ((currentItem->selectedMeshPointX > -1) && (currentItem->selectedMeshPointY > 0))
+	{
+		colorMeshPoint->setEnabled(true);
+		shadeMeshPoint->setEnabled(true);
+		transparencyMeshPoint->setEnabled(true);
+		meshGradientPatch patch = currentItem->meshGradientPatches[currentItem->selectedMeshPointX];
+		meshPoint mp;
+		switch (currentItem->selectedMeshPointY)
+		{
+			case 1:
+				mp = patch.TL;
+				break;
+			case 2:
+				mp = patch.TR;
+				break;
+			case 3:
+				mp = patch.BR;
+				break;
+			case 4:
+				mp = patch.BL;
+				break;
+		}
+		setCurrentComboItem(colorMeshPoint, mp.colorName);
+		shadeMeshPoint->setValue(mp.shade);
+		transparencyMeshPoint->setValue(mp.transparency * 100);
+	}
+	else
+	{
+		colorMeshPoint->setEnabled(false);
+		shadeMeshPoint->setEnabled(false);
+		transparencyMeshPoint->setEnabled(false);
+	}
 }
 
 void Cpalette::changePatternProps()

Modified: trunk/Scribus/scribus/ui/cpalette.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16869&path=/trunk/Scribus/scribus/ui/cpalette.h
==============================================================================
--- trunk/Scribus/scribus/ui/cpalette.h (original)
+++ trunk/Scribus/scribus/ui/cpalette.h Mon Oct  3 07:47:18 2011
@@ -119,6 +119,7 @@
 	void setSpecialGradient(double x1, double y1, double x2, double y2, double fx, double fy, double sg, double sk, double cx, double cy);
 	void setMeshPoint();
 	void setMeshControlPoint();
+	void setMeshPatchPoint();
 	void updateMeshPoint();
 	void changePatternProps();
 	void changePatternPropsStroke();

Modified: trunk/Scribus/scribus/ui/gradientvectorbase.ui
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16869&path=/trunk/Scribus/scribus/ui/gradientvectorbase.ui
==============================================================================
--- trunk/Scribus/scribus/ui/gradientvectorbase.ui (original)
+++ trunk/Scribus/scribus/ui/gradientvectorbase.ui Mon Oct  3 07:47:18 2011
@@ -9,8 +9,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>248</width>
-    <height>163</height>
+    <width>251</width>
+    <height>180</height>
    </rect>
   </property>
   <property name="minimumSize">
@@ -748,6 +748,175 @@
           <size>
            <width>20</width>
            <height>62</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="pagePatch">
+      <layout class="QVBoxLayout" name="verticalLayout_3">
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_3">
+         <item>
+          <layout class="QGridLayout" name="gridLayout_7">
+           <item row="0" column="0">
+            <widget class="QToolButton" name="editPPoint">
+             <property name="minimumSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+             <property name="toolTip">
+              <string>Edit Grid Points</string>
+             </property>
+             <property name="text">
+              <string/>
+             </property>
+             <property name="checkable">
+              <bool>true</bool>
+             </property>
+             <property name="autoExclusive">
+              <bool>true</bool>
+             </property>
+            </widget>
+           </item>
+           <item row="1" column="0">
+            <widget class="QToolButton" name="editPControlPoints">
+             <property name="minimumSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+             <property name="toolTip">
+              <string>Edit Control Points</string>
+             </property>
+             <property name="text">
+              <string/>
+             </property>
+             <property name="checkable">
+              <bool>true</bool>
+             </property>
+             <property name="autoExclusive">
+              <bool>true</bool>
+             </property>
+            </widget>
+           </item>
+           <item row="1" column="1">
+            <widget class="QToolButton" name="resetPControlPoint">
+             <property name="enabled">
+              <bool>false</bool>
+             </property>
+             <property name="minimumSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+             <property name="toolTip">
+              <string>Reset selected Control Point</string>
+             </property>
+             <property name="text">
+              <string/>
+             </property>
+             <property name="checkable">
+              <bool>false</bool>
+             </property>
+             <property name="autoExclusive">
+              <bool>false</bool>
+             </property>
+            </widget>
+           </item>
+           <item row="1" column="2">
+            <widget class="QToolButton" name="resetAllPControlPoints">
+             <property name="enabled">
+              <bool>false</bool>
+             </property>
+             <property name="minimumSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+             <property name="toolTip">
+              <string>Reset all Control Points</string>
+             </property>
+             <property name="text">
+              <string/>
+             </property>
+             <property name="checkable">
+              <bool>false</bool>
+             </property>
+             <property name="autoExclusive">
+              <bool>false</bool>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <spacer name="horizontalSpacer_3">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_4">
+         <item>
+          <widget class="QPushButton" name="buttonAddPatch">
+           <property name="enabled">
+            <bool>false</bool>
+           </property>
+           <property name="text">
+            <string>Add Patch</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QPushButton" name="buttonRemovePatch">
+           <property name="enabled">
+            <bool>false</bool>
+           </property>
+           <property name="text">
+            <string>Remove Patch</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <spacer name="horizontalSpacer_4">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>13</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <spacer name="verticalSpacer_2">
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>20</width>
+           <height>32</height>
           </size>
          </property>
         </spacer>

Modified: trunk/Scribus/scribus/ui/gradientvectordialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16869&path=/trunk/Scribus/scribus/ui/gradientvectordialog.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/gradientvectordialog.cpp (original)
+++ trunk/Scribus/scribus/ui/gradientvectordialog.cpp Mon Oct  3 07:47:18 2011
@@ -71,6 +71,10 @@
 	connect(buttonPoLIne, SIGNAL(clicked()), this, SIGNAL(meshToShape()));
 	connect(resetControlPoint, SIGNAL(clicked()), this, SIGNAL(reset1Control()));
 	connect(resetAllControlPoints, SIGNAL(clicked()), this, SIGNAL(resetAllControl()));
+	connect(editPPoint, SIGNAL(clicked()), this, SLOT(handlePEditButton()));
+	connect(editPControlPoints, SIGNAL(clicked()), this, SLOT(handlePEditControlButton()));
+	connect(resetPControlPoint, SIGNAL(clicked()), this, SIGNAL(reset1Control()));
+	connect(resetAllPControlPoints, SIGNAL(clicked()), this, SIGNAL(resetAllControl()));
 	QSize iconSize = QSize(22, 22);
 	editPoints->setIcon(QIcon(loadIcon("MoveNode.png")));
 	editPoints->setIconSize(iconSize);
@@ -80,6 +84,14 @@
 	resetControlPoint->setIconSize(iconSize);
 	resetAllControlPoints->setIcon(QIcon(loadIcon("ResetNode.png")));
 	resetAllControlPoints->setIconSize(iconSize);
+	editPPoint->setIcon(QIcon(loadIcon("MoveNode.png")));
+	editPPoint->setIconSize(iconSize);
+	editPControlPoints->setIcon(QIcon(loadIcon("MoveKontrol.png")));
+	editPControlPoints->setIconSize(iconSize);
+	resetPControlPoint->setIcon(QIcon(loadIcon("Reset1Node.png")));
+	resetPControlPoint->setIconSize(iconSize);
+	resetAllPControlPoints->setIcon(QIcon(loadIcon("ResetNode.png")));
+	resetAllPControlPoints->setIconSize(iconSize);
 	languageChange();
 	selectLinear();
 }
@@ -135,6 +147,13 @@
 	resize(minimumSizeHint());
 }
 
+void GradientVectorDialog::selectPatchMesh()
+{
+	stackedWidget->setCurrentIndex(5);
+	editPPoint->setChecked(true);
+	resize(minimumSizeHint());
+}
+
 void GradientVectorDialog::languageChange()
 {
 	retranslateUi(this);
@@ -158,6 +177,26 @@
 		resetAllControlPoints->setEnabled(true);
 		resetControlPoint->setEnabled(true);
 		emit editGradient(7);
+	}
+}
+
+void GradientVectorDialog::handlePEditButton()
+{
+	if (editPPoint->isChecked())
+	{
+		resetAllPControlPoints->setEnabled(false);
+		resetPControlPoint->setEnabled(false);
+		emit editGradient(9);
+	}
+}
+
+void GradientVectorDialog::handlePEditControlButton()
+{
+	if (editPControlPoints->isChecked())
+	{
+		resetAllPControlPoints->setEnabled(true);
+		resetPControlPoint->setEnabled(true);
+		emit editGradient(10);
 	}
 }
 

Modified: trunk/Scribus/scribus/ui/gradientvectordialog.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16869&path=/trunk/Scribus/scribus/ui/gradientvectordialog.h
==============================================================================
--- trunk/Scribus/scribus/ui/gradientvectordialog.h (original)
+++ trunk/Scribus/scribus/ui/gradientvectordialog.h Mon Oct  3 07:47:18 2011
@@ -51,11 +51,14 @@
 	void selectFourColor();
 	void selectDiamond();
 	void selectMesh();
+	void selectPatchMesh();
 
 public slots:
 	void languageChange();
 	void handleEditButton();
 	void handleEditControlButton();
+	void handlePEditButton();
+	void handlePEditControlButton();
 	void setValues(double x1, double y1, double x2, double y2, double fx, double fy, double sg, double sk, double cx, double cy);
 	void changeSpecialL();
 	void changeSpecialR();

Modified: trunk/Scribus/scribus/ui/outlinepalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16869&path=/trunk/Scribus/scribus/ui/outlinepalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/outlinepalette.cpp (original)
+++ trunk/Scribus/scribus/ui/outlinepalette.cpp Mon Oct  3 07:47:18 2011
@@ -164,7 +164,7 @@
  
 	filterEdit = new QLineEdit;
 	filterEdit->setToolTip( tr("Enter a keyword or regular expression to filter the outline.") );
-	QShortcut* filterShortcut = new QShortcut( QKeySequence( tr( "Ctrl+F", "Filter the Outline using a keyword" ) ), this );
+//	QShortcut* filterShortcut = new QShortcut( QKeySequence( tr( "Ctrl+F", "Filter the Outline using a keyword" ) ), this );
 	filterLabel = new QLabel( tr("Filter:") );
 	filterLabel->setBuddy( filterEdit );
 
@@ -216,7 +216,7 @@
 	connect(reportDisplay, SIGNAL(itemSelectionChanged()), this, SLOT(slotMultiSelect()));
 	connect(reportDisplay, SIGNAL(itemChanged(QTreeWidgetItem*, int)), this, SLOT(slotDoRename(QTreeWidgetItem*, int)));
 	connect(filterEdit, SIGNAL(textChanged(const QString&)), this, SLOT(filterTree(const QString&)));
-	connect(filterShortcut, SIGNAL(activated()), filterEdit, SLOT(setFocus()));
+//	connect(filterShortcut, SIGNAL(activated()), filterEdit, SLOT(setFocus()));
 }
 
 void OutlinePalette::setMainWindow(ScribusMainWindow *mw)

Modified: trunk/Scribus/scribus/ui/propertiespalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16869&path=/trunk/Scribus/scribus/ui/propertiespalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette.cpp (original)
+++ trunk/Scribus/scribus/ui/propertiespalette.cpp Mon Oct  3 07:47:18 2011
@@ -816,6 +816,8 @@
 			{
 				if ((stroke == 5) || (stroke == 6) || (stroke == 7))
 					m_ScMW->view->requestMode(modeEditMeshGradient);
+				else if ((stroke == 8) || (stroke == 9) || (stroke == 10))
+					m_ScMW->view->requestMode(modeEditMeshPatch);
 				else
 					m_ScMW->view->requestMode(modeEditGradientVectors);
 			}
@@ -976,6 +978,8 @@
 			Cpal->setMeshPoint();
 		else if (m_ScMW->view->editStrokeGradient == 7)
 			Cpal->setMeshControlPoint();
+		else if (m_ScMW->view->editStrokeGradient == 8)
+			Cpal->setMeshPatchPoint();
 		else if (!currItem->isGroup())
 			Tpal->setSpecialGradient(currItem->GrMaskStartX * dur, currItem->GrMaskStartY * dur, currItem->GrMaskEndX * dur, currItem->GrMaskEndY * dur, currItem->GrMaskFocalX * dur, currItem->GrMaskFocalY * dur, currItem->GrMaskScale, currItem->GrMaskSkew);
 	}




More information about the scribus-commit mailing list