r16977 by fschmid - More fixes for the various edit modes when an object inside a group is edited.

scribus-commit scribus-commit at lists.scribus.net
Tue Nov 15 12:31:47 UTC 2011


Author: fschmid
Date: Tue Nov 15 12:31:47 2011
New Revision: 16977

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=16977
Log:
More fixes for the various edit modes when an object inside a group is edited.

Modified:
    trunk/Scribus/scribus/canvasmode_editarc.cpp
    trunk/Scribus/scribus/canvasmode_editgradient.cpp
    trunk/Scribus/scribus/canvasmode_editmeshgradient.cpp
    trunk/Scribus/scribus/canvasmode_editmeshpatch.cpp
    trunk/Scribus/scribus/canvasmode_editpolygon.cpp
    trunk/Scribus/scribus/canvasmode_editspiral.cpp
    trunk/Scribus/scribus/ui/cpalette.cpp
    trunk/Scribus/scribus/ui/polygonwidget.cpp
    trunk/Scribus/scribus/ui/propertiespalette_xyz.cpp

Modified: trunk/Scribus/scribus/canvasmode_editarc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16977&path=/trunk/Scribus/scribus/canvasmode_editarc.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editarc.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_editarc.cpp Tue Nov 15 12:31:47 2011
@@ -97,8 +97,7 @@
 	QPen p1bd = QPen(Qt::blue, 1.0 / m_canvas->m_viewMode.scale, Qt::DotLine, Qt::FlatCap, Qt::MiterJoin);
 	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);
-	psx->translate(static_cast<int>(currItem->xPos()), static_cast<int>(currItem->yPos()));
-	psx->rotate(currItem->rotation());
+	psx->setTransform(currItem->getTransform(), true);
 	psx->setPen(p1b);
 	psx->setBrush(Qt::NoBrush);
 	QPainterPath pp;
@@ -255,7 +254,8 @@
 	centerPoint = currItem->PoLine.pointQF(0);
 	widthPoint = QPointF(centerPoint.x() - item->arcWidth / 2.0, centerPoint.y());
 	heightPoint = QPointF(centerPoint.x(), centerPoint.y() - item->arcHeight / 2.0);
-	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));
+	QTransform itemMatrix = currItem->getTransform();
+	m_doc->regionsChanged()->update(itemMatrix.mapRect(QRectF(0, 0, currItem->width(), currItem->height())).adjusted(-currItem->width() / 2.0, -currItem->height() / 2.0, currItem->width(), currItem->height()));
 }
 
 void CanvasMode_EditArc::deactivate(bool forGesture)
@@ -286,9 +286,7 @@
 	if (m_canvas->m_viewMode.m_MouseButtonPressed && m_view->moveTimerElapsed())
 	{
 		PageItem *currItem = m_doc->m_Selection->itemAt(0);
-		QTransform itemMatrix;
-		itemMatrix.translate(currItem->xPos(), currItem->yPos());
-		itemMatrix.rotate(currItem->rotation());
+		QTransform itemMatrix = currItem->getTransform();
 		QPointF sPoint = currItem->PoLine.pointQF(0);
 		QPointF smPoint = itemMatrix.map(sPoint);
 		QLineF stLinA = QLineF(smPoint, QPointF(Mxp, Myp));
@@ -331,10 +329,7 @@
 		blockUpdateFromItem(true);
 		currItem->update();
 		blockUpdateFromItem(false);
-		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_doc->regionsChanged()->update(itemMatrix.mapRect(QRectF(0, 0, currItem->width(), currItem->height())).adjusted(-currItem->width() / 2.0, -currItem->height() / 2.0, currItem->width(), currItem->height()));
 	}
 	Mxp = newX;
 	Myp = newY;
@@ -361,10 +356,8 @@
 			m_view->DrawNew();
 		return;
 	}
-	QTransform itemMatrix;
 	PageItem *currItem = m_doc->m_Selection->itemAt(0);
-	itemMatrix.translate(currItem->xPos(), currItem->yPos());
-	itemMatrix.rotate(currItem->rotation());
+	QTransform itemMatrix = currItem->getTransform();
 	QPointF stPoint = startPoint;
 	stPoint = itemMatrix.map(stPoint);
 	QPointF swPoint = endPoint;
@@ -385,10 +378,7 @@
 		m_arcPoint = noPointDefined;
 	m_canvas->m_viewMode.m_MouseButtonPressed = true;
 	qApp->changeOverrideCursor(QCursor(Qt::CrossCursor));
-	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_doc->regionsChanged()->update(itemMatrix.mapRect(QRectF(0, 0, currItem->width(), currItem->height())).adjusted(-currItem->width() / 2.0, -currItem->height() / 2.0, currItem->width(), currItem->height()));
 }
 
 void CanvasMode_EditArc::mouseReleaseEvent(QMouseEvent *m)
@@ -400,10 +390,6 @@
 	PageItem *currItem = m_doc->m_Selection->itemAt(0);
 	PageItem_Arc* item = currItem->asArc();
 	QPointF mPoint = item->PoLine.pointQF(0);
-	QRectF upRect = QRectF(QPointF(0, 0), QPointF(currItem->width(), currItem->height())).normalized();
-	QRectF upRect2 = QRectF(mPoint.x() - item->arcWidth / 2.0, mPoint.y() - item->arcHeight / 2.0, item->arcWidth, item->arcHeight);
-	upRect = upRect2.united(upRect);
-	upRect.translate(currItem->xPos(), currItem->yPos());
 	if ((m_arcPoint == useControlStart) || (m_arcPoint == useControlSweep) || (m_arcPoint == useControlHeight) || (m_arcPoint == useControlWidth))
 	{
 		double nWidth = mPoint.x() - widthPoint.x();
@@ -429,5 +415,6 @@
 		startAngle = item->arcStartAngle;
 		endAngle = startAngle + item->arcSweepAngle;
 	}
-	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));
-}
+	QTransform itemMatrix = currItem->getTransform();
+	m_doc->regionsChanged()->update(itemMatrix.mapRect(QRectF(0, 0, currItem->width(), currItem->height())).adjusted(-currItem->width() / 2.0, -currItem->height() / 2.0, currItem->width(), currItem->height()));
+}

Modified: trunk/Scribus/scribus/canvasmode_editgradient.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16977&path=/trunk/Scribus/scribus/canvasmode_editgradient.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editgradient.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_editgradient.cpp Tue Nov 15 12:31:47 2011
@@ -83,13 +83,7 @@
 
 void CanvasMode_EditGradient::drawControlsGradientVectors(QPainter* psx, PageItem *currItem)
 {
-//	psx->resetMatrix();
-//	QPoint out = contentsToViewport(QPoint(0, 0));
-//	psx->translate(out.x(), out.y());
-//	psx->translate(-qRound(m_doc->minCanvasCoordinate.x()*m_viewMode.scale), -qRound(m_doc->minCanvasCoordinate.y()*m_viewMode.scale));
-	//Transform(currItem, psx);
-	psx->translate(static_cast<int>(currItem->xPos()), static_cast<int>(currItem->yPos()));
-	psx->rotate(currItem->rotation());
+	psx->setTransform(currItem->getTransform(), true);
 	psx->setPen(QPen(Qt::blue, 1.0 / m_canvas->m_viewMode.scale, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin));
 	psx->setBrush(Qt::NoBrush);
 	if (m_view->editStrokeGradient == 1)
@@ -704,7 +698,8 @@
 		{
 			upRect = QRectF(QPointF(-currItem->width(), -currItem->height()), QPointF(currItem->width() * 2, currItem->height() * 2)).normalized();
 		}
-		upRect.translate(currItem->xPos(), currItem->yPos());
+		QTransform itemMatrix = currItem->getTransform();
+		upRect = itemMatrix.mapRect(upRect);
 		if (currItem->GrType == 13)
 			currItem->createConicalMesh();
 		m_doc->regionsChanged()->update(upRect.adjusted(-10.0, -10.0, 10.0, 10.0));
@@ -733,10 +728,8 @@
 			m_view->DrawNew();
 		return;
 	}
-	QTransform itemMatrix;
 	PageItem *currItem = m_doc->m_Selection->itemAt(0);
-	itemMatrix.translate(currItem->xPos(), currItem->yPos());
-	itemMatrix.rotate(currItem->rotation());
+	QTransform itemMatrix = currItem->getTransform();
 	QPointF gradientStart, gradientEnd, gradientFocal, gradientScale, gradientCenter;
 	if (m_view->editStrokeGradient == 1)
 	{

Modified: trunk/Scribus/scribus/canvasmode_editmeshgradient.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16977&path=/trunk/Scribus/scribus/canvasmode_editmeshgradient.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editmeshgradient.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_editmeshgradient.cpp Tue Nov 15 12:31:47 2011
@@ -100,8 +100,7 @@
 	QPen p8m = QPen(Qt::magenta, 8.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->setTransform(currItem->getTransform(), true);
 	psx->setPen(p1b);
 	psx->setBrush(Qt::NoBrush);
 	for (int grow = 0; grow < currItem->meshGradientArray.count()-1; grow++)
@@ -587,7 +586,8 @@
 		else
 			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);
+		QTransform pp = currItem->getTransform();
+		FPoint npf = npfN.transformPoint(pp, true);
 		if (m_view->editStrokeGradient == 6)
 		{
 			if (selectedMeshPoints.count() > 0)
@@ -629,10 +629,8 @@
 					currItem->meshGradientArray[selP.first][selP.second].controlRight -= npx;
 			}
 			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));
+			QTransform itemMatrix = currItem->getTransform();
+			m_doc->regionsChanged()->update(itemMatrix.mapRect(QRectF(0, 0, currItem->width(), currItem->height())).adjusted(-currItem->width() / 2.0, -currItem->height() / 2.0, currItem->width(), currItem->height()));
 		}
 		Mxp = npfN.x();
 		Myp = npfN.y();
@@ -660,10 +658,8 @@
 			m_view->DrawNew();
 		return;
 	}
-	QTransform itemMatrix;
 	PageItem *currItem = m_doc->m_Selection->itemAt(0);
-	itemMatrix.translate(currItem->xPos(), currItem->yPos());
-	itemMatrix.rotate(currItem->rotation());
+	QTransform itemMatrix = currItem->getTransform();
 	bool found = false;
 	QPair<int, int> selPoint;
 	if (m_view->editStrokeGradient == 5)
@@ -969,10 +965,7 @@
 	m_canvas->m_viewMode.m_MouseButtonPressed = true;
 	m_ScMW->propertiesPalette->updateColorSpecialGradient();
 	qApp->changeOverrideCursor(QCursor(Qt::CrossCursor));
-	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_doc->regionsChanged()->update(itemMatrix.mapRect(QRectF(0, 0, currItem->width(), currItem->height())).adjusted(-currItem->width() / 2.0, -currItem->height() / 2.0, currItem->width(), currItem->height()));
 }
 
 void CanvasMode_EditMeshGradient::mouseReleaseEvent(QMouseEvent *m)
@@ -983,8 +976,6 @@
 	m->accept();
 	PageItem *currItem = m_doc->m_Selection->itemAt(0);
 	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));
-}
+	QTransform itemMatrix = currItem->getTransform();
+	m_doc->regionsChanged()->update(itemMatrix.mapRect(QRectF(0, 0, currItem->width(), currItem->height())).adjusted(-currItem->width() / 2.0, -currItem->height() / 2.0, currItem->width(), currItem->height()));
+}

Modified: trunk/Scribus/scribus/canvasmode_editmeshpatch.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16977&path=/trunk/Scribus/scribus/canvasmode_editmeshpatch.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editmeshpatch.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_editmeshpatch.cpp Tue Nov 15 12:31:47 2011
@@ -133,8 +133,7 @@
 	QPen p8m = QPen(Qt::magenta, 8.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->setTransform(currItem->getTransform(), true);
 	psx->setPen(p1b);
 	psx->setBrush(Qt::NoBrush);
 
@@ -524,10 +523,8 @@
 			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));
+				QTransform itemMatrix = currItem->getTransform();
+				m_doc->regionsChanged()->update(itemMatrix.mapRect(QRectF(0, 0, currItem->width(), currItem->height())).adjusted(-currItem->width() / 2.0, -currItem->height() / 2.0, currItem->width(), currItem->height()));
 			}
 		}
 	}
@@ -583,7 +580,8 @@
 	else
 		npfN = FPoint(nx, ny);
 	currItem = m_doc->m_Selection->itemAt(0);
-	FPoint npf = FPoint(npfN.x(), npfN.y(), currItem->xPos(), currItem->yPos(), currItem->rotation(), 1, 1, true);
+	QTransform pp = currItem->getTransform();
+	FPoint npf = npfN.transformPoint(pp, true);
 	FPoint npx(Mxp - npfN.x(), Myp - npfN.y(), 0, 0, currItem->rotation(), 1, 1, true);
 	if (m_view->editStrokeGradient == 11)
 	{
@@ -733,10 +731,8 @@
 					}
 				}
 				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));
+				QTransform itemMatrix = currItem->getTransform();
+				m_doc->regionsChanged()->update(itemMatrix.mapRect(QRectF(0, 0, currItem->width(), currItem->height())).adjusted(-currItem->width() / 2.0, -currItem->height() / 2.0, currItem->width(), currItem->height()));
 			}
 		}
 	}
@@ -765,10 +761,8 @@
 			m_view->DrawNew();
 		return;
 	}
-	QTransform itemMatrix;
 	currItem = m_doc->m_Selection->itemAt(0);
-	itemMatrix.translate(currItem->xPos(), currItem->yPos());
-	itemMatrix.rotate(currItem->rotation());
+	QTransform itemMatrix = currItem->getTransform();
 	bool found = false;
 	if (m_view->editStrokeGradient == 11)
 	{
@@ -950,10 +944,8 @@
 	m_canvas->m_viewMode.m_MouseButtonPressed = true;
 	m_ScMW->propertiesPalette->updateColorSpecialGradient();
 	qApp->changeOverrideCursor(QCursor(Qt::CrossCursor));
-	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_doc->regionsChanged()->update(itemMatrix.mapRect(QRectF(0, 0, currItem->width(), currItem->height())).adjusted(-currItem->width() / 2.0, -currItem->height() / 2.0, currItem->width(), currItem->height()));
+
 }
 
 void CanvasMode_EditMeshPatch::mouseReleaseEvent(QMouseEvent *m)
@@ -964,10 +956,8 @@
 	m->accept();
 	currItem = m_doc->m_Selection->itemAt(0);
 	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));
+	QTransform itemMatrix = currItem->getTransform();
+	m_doc->regionsChanged()->update(itemMatrix.mapRect(QRectF(0, 0, currItem->width(), currItem->height())).adjusted(-currItem->width() / 2.0, -currItem->height() / 2.0, currItem->width(), currItem->height()));
 }
 
 void CanvasMode_EditMeshPatch::snapToOtherPatch(double &x, double &y)

Modified: trunk/Scribus/scribus/canvasmode_editpolygon.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16977&path=/trunk/Scribus/scribus/canvasmode_editpolygon.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editpolygon.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_editpolygon.cpp Tue Nov 15 12:31:47 2011
@@ -90,8 +90,7 @@
 	QPen p1bd = QPen(Qt::red, 1.0 / m_canvas->m_viewMode.scale, Qt::DotLine, Qt::FlatCap, Qt::MiterJoin);
 	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);
-	psx->translate(static_cast<int>(currItem->xPos()), static_cast<int>(currItem->yPos()));
-	psx->rotate(currItem->rotation());
+	psx->setTransform(currItem->getTransform(), true);
 	psx->setPen(p1b);
 	psx->setBrush(Qt::NoBrush);
 	PageItem_RegularPolygon* item = currItem->asRegularPolygon();
@@ -256,9 +255,9 @@
 	item->polyOuterCurvature = polyOuterCurvature;
 	item->recalcPath();
 	updateFromItem();
-	QRectF 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));
+	QTransform itemMatrix = currItem->getTransform();
+	QPainterPath path = itemMatrix.map(RegularPolygonPath(item->width(), item->height(), polyCorners, polyUseFactor, polyFactor, polyRotation, polyCurvature, polyInnerRot, polyOuterCurvature));
+	m_doc->regionsChanged()->update(path.boundingRect().adjusted(-5, -5, 10, 10));
 }
 
 double CanvasMode_EditPolygon::getUserValFromFactor(double factor)
@@ -306,9 +305,7 @@
 	if (m_canvas->m_viewMode.m_MouseButtonPressed && m_view->moveTimerElapsed())
 	{
 		PageItem *currItem = m_doc->m_Selection->itemAt(0);
-		QTransform itemMatrix;
-		itemMatrix.translate(currItem->xPos(), currItem->yPos());
-		itemMatrix.rotate(currItem->rotation());
+		QTransform itemMatrix = currItem->getTransform();
 		QPointF cPoint = itemMatrix.map(centerPoint);
 		QLineF stLinA = QLineF(cPoint, QPointF(newX, newY));
 		
@@ -362,10 +359,8 @@
 		blockUpdateFromItem(true);
 		currItem->update();
 		blockUpdateFromItem(false);
-		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));
+		path = itemMatrix.map(path);
+		m_doc->regionsChanged()->update(path.boundingRect().adjusted(-5, -5, 10, 10));
 	}
 	Mxp = newX;
 	Myp = newY;
@@ -392,10 +387,8 @@
 			m_view->DrawNew();
 		return;
 	}
-	QTransform itemMatrix;
 	PageItem *currItem = m_doc->m_Selection->itemAt(0);
-	itemMatrix.translate(currItem->xPos(), currItem->yPos());
-	itemMatrix.rotate(currItem->rotation());
+	QTransform itemMatrix = currItem->getTransform();
 	QPointF stPoint = startPoint;
 	stPoint = itemMatrix.map(stPoint);
 	QPointF swPoint = endPoint;
@@ -439,10 +432,8 @@
 	else
 		m_polygonPoint = noPointDefined;
 	qApp->changeOverrideCursor(QCursor(Qt::CrossCursor));
-	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));
+	QPainterPath path = itemMatrix.map(RegularPolygonPath(currItem->width(), currItem->height(), polyCorners, polyUseFactor, polyFactor, polyRotation, polyCurvature, polyInnerRot, polyOuterCurvature));
+	m_doc->regionsChanged()->update(path.boundingRect().adjusted(-5, -5, 10, 10));
 }
 
 void CanvasMode_EditPolygon::mouseReleaseEvent(QMouseEvent *m)
@@ -453,13 +444,11 @@
 	m->accept();
 	PageItem *currItem = m_doc->m_Selection->itemAt(0);
 	PageItem_RegularPolygon* item = currItem->asRegularPolygon();
+	QTransform itemMatrix = currItem->getTransform();
 	if ((m_polygonPoint == useControlInner) || (m_polygonPoint == useControlOuter) || (m_polygonPoint == useControlInnerCurve) || (m_polygonPoint == useControlOuterCurve))
 	{
 		double newX = mousePointDoc.x();
 		double newY = mousePointDoc.y();
-		QTransform itemMatrix;
-		itemMatrix.translate(currItem->xPos(), currItem->yPos());
-		itemMatrix.rotate(currItem->rotation());
 		QPointF cPoint = itemMatrix.map(centerPoint);
 		QLineF stLinA = QLineF(cPoint, QPointF(newX, newY));
 		uint cx = polyUseFactor ? polyCorners * 2 : polyCorners;
@@ -494,7 +483,6 @@
 		item->recalcPath();
 		VectorDialog->setValues(polyCorners, polyFactor, polyUseFactor, polyRotation, polyCurvature, polyInnerRot, polyOuterCurvature);
 	}
-	QRectF 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));
-}
+	QPainterPath path = itemMatrix.map(RegularPolygonPath(item->width(), item->height(), polyCorners, polyUseFactor, polyFactor, polyRotation, polyCurvature, polyInnerRot, polyOuterCurvature));
+	m_doc->regionsChanged()->update(path.boundingRect().adjusted(-5, -5, 10, 10));
+}

Modified: trunk/Scribus/scribus/canvasmode_editspiral.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16977&path=/trunk/Scribus/scribus/canvasmode_editspiral.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editspiral.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_editspiral.cpp Tue Nov 15 12:31:47 2011
@@ -79,8 +79,7 @@
 {
 	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);
-	psx->translate(static_cast<int>(currItem->xPos()), static_cast<int>(currItem->yPos()));
-	psx->rotate(currItem->rotation());
+	psx->setTransform(currItem->getTransform(), true);
 	psx->setBrush(Qt::NoBrush);
 	psx->setPen(p8b);
 	if (m_arcPoint == useControlStart)
@@ -230,8 +229,6 @@
 	PageItem *currItem = m_doc->m_Selection->itemAt(0);
 	PageItem_Spiral *item = currItem->asSpiral();
 	QPointF mPoint = item->PoLine.pointQF(0);
-	QRectF upRect = QRectF(QPointF(0, 0), QPointF(currItem->width(), currItem->height())).normalized();
-	upRect.translate(currItem->xPos(), currItem->yPos());
 	item->spiralStartAngle = computeRealAngle(start, true);
 	item->spiralEndAngle = computeRealAngle(end, true);
 	item->spiralFactor = factor;
@@ -240,7 +237,8 @@
 	endPoint = currItem->PoLine.pointQF(currItem->PoLine.size() - 2);
 	startAngle = item->spiralStartAngle;
 	endAngle = item->spiralEndAngle;
-	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));
+	QTransform itemMatrix = currItem->getTransform();
+	m_doc->regionsChanged()->update(itemMatrix.mapRect(QRectF(0, 0, currItem->width(), currItem->height())).adjusted(-5, -5, 10, 10));
 }
 
 void CanvasMode_EditSpiral::deactivate(bool forGesture)
@@ -271,10 +269,8 @@
 	if (m_canvas->m_viewMode.m_MouseButtonPressed && m_view->moveTimerElapsed() && (m_arcPoint != noPointDefined))
 	{
 		PageItem *currItem = m_doc->m_Selection->itemAt(0);
+		QTransform itemMatrix = currItem->getTransform();
 		PageItem_Spiral *item = currItem->asSpiral();
-		QTransform itemMatrix;
-		itemMatrix.translate(currItem->xPos(), currItem->yPos());
-		itemMatrix.rotate(currItem->rotation());
 		QPointF sPoint;
 		if (m_arcPoint == useControlStart)
 			sPoint = getSegment(startAngle);
@@ -317,10 +313,7 @@
 			VectorDialog->setValues(computeRealAngle(startAngle, false), computeRealAngle(endAngle, false), item->spiralFactor);
 		}
 		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_doc->regionsChanged()->update(itemMatrix.mapRect(QRectF(0, 0, currItem->width(), currItem->height())).adjusted(-5, -5, 10, 10));
 	}
 	Mxp = newX;
 	Myp = newY;
@@ -329,7 +322,6 @@
 void CanvasMode_EditSpiral::mousePressEvent(QMouseEvent *m)
 {
 	const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
-
 	m_canvas->PaintSizeRect(QRect());
 	m_canvas->m_viewMode.m_MouseButtonPressed = true;
 	m_canvas->m_viewMode.operItemMoving = false;
@@ -347,10 +339,8 @@
 			m_view->DrawNew();
 		return;
 	}
-	QTransform itemMatrix;
-	PageItem *currItem = m_doc->m_Selection->itemAt(0);
-	itemMatrix.translate(currItem->xPos(), currItem->yPos());
-	itemMatrix.rotate(currItem->rotation());
+	PageItem *currItem = m_doc->m_Selection->itemAt(0);
+	QTransform itemMatrix = currItem->getTransform();
 	QPointF stPoint = startPoint;
 	stPoint = itemMatrix.map(stPoint);
 	QPointF swPoint = endPoint;
@@ -363,19 +353,15 @@
 		m_arcPoint = noPointDefined;
 	m_canvas->m_viewMode.m_MouseButtonPressed = true;
 	qApp->changeOverrideCursor(QCursor(Qt::CrossCursor));
-	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_doc->regionsChanged()->update(itemMatrix.mapRect(QRectF(0, 0, currItem->width(), currItem->height())).adjusted(-5, -5, 10, 10));
 }
 
 void CanvasMode_EditSpiral::mouseReleaseEvent(QMouseEvent *m)
 {
-	const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
 	m_canvas->m_viewMode.m_MouseButtonPressed = false;
 	m_canvas->resetRenderMode();
 	m->accept();
 	PageItem *currItem = m_doc->m_Selection->itemAt(0);
-	QRectF upRect = QRectF(QPointF(0, 0), QPointF(currItem->width(), currItem->height())).normalized();
-	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));
-}
+	QTransform itemMatrix = currItem->getTransform();
+	m_doc->regionsChanged()->update(itemMatrix.mapRect(QRectF(0, 0, currItem->width(), currItem->height())).adjusted(-5, -5, 10, 10));
+}

Modified: trunk/Scribus/scribus/ui/cpalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16977&path=/trunk/Scribus/scribus/ui/cpalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/cpalette.cpp (original)
+++ trunk/Scribus/scribus/ui/cpalette.cpp Tue Nov 15 12:31:47 2011
@@ -1408,6 +1408,7 @@
 	double t = transparencyMeshPoint->value() / 100.0;
 	currentItem->setMeshPointColor(currentItem->selectedMeshPointX, currentItem->selectedMeshPointY, color, shadeMeshPoint->value(), t, currentDoc->view()->editStrokeGradient == 8);
 	currentItem->update();
+	currentDoc->regionsChanged()->update(QRect());
 }
 
 void Cpalette::setMeshPatchPoint()

Modified: trunk/Scribus/scribus/ui/polygonwidget.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16977&path=/trunk/Scribus/scribus/ui/polygonwidget.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/polygonwidget.cpp (original)
+++ trunk/Scribus/scribus/ui/polygonwidget.cpp Tue Nov 15 12:31:47 2011
@@ -186,7 +186,7 @@
 {
 	if (editMode)
 	{
-		emit NewVectors(cornersSpinBox->value(), PFactor, applyConvexGroupBox->isChecked(), rotationSpinBox->value(), curvatureSpinBox->value() / 100.0, innerRotationspinBox->value(), OuterCurvatureSpinBox->value() / 100.0);
+		emit NewVectors(cornersSpinBox->value(), GetFactor(), applyConvexGroupBox->isChecked(), rotationSpinBox->value(), curvatureSpinBox->value() / 100.0, innerRotationspinBox->value(), OuterCurvatureSpinBox->value() / 100.0);
 		return;
 	}
 	double roundness = curvatureSpinBox->value() / 100.0;

Modified: trunk/Scribus/scribus/ui/propertiespalette_xyz.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16977&path=/trunk/Scribus/scribus/ui/propertiespalette_xyz.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_xyz.cpp (original)
+++ trunk/Scribus/scribus/ui/propertiespalette_xyz.cpp Tue Nov 15 12:31:47 2011
@@ -316,8 +316,8 @@
 	double selH = m_item->height();
 	if (m_doc->m_Selection->count() > 1)
 		m_doc->m_Selection->getGroupRect(&selX, &selY, &selW, &selH);
-	displayXY(selX, selY);
-	displayWH(selW, selH);
+//	displayXY(selX, selY);
+//	displayWH(selW, selH);
 	
 	bool checkableFlip = (i->isImageFrame() || i->isTextFrame() || i->isLatexFrame() || i->isOSGFrame() || i->isSymbol() || i->isGroup() || i->isSpiral());
 	flipH->setCheckable(checkableFlip);




More information about the scribus-commit mailing list