r18666 by fschmid - Fixed Bug #11768: Arc selection frame in case of cheese piece

scribus-commit scribus-commit at lists.scribus.net
Wed Dec 25 12:05:15 UTC 2013


Author: fschmid
Date: Wed Dec 25 12:05:14 2013
New Revision: 18666

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18666
Log:
Fixed Bug #11768: Arc selection frame in case of cheese piece

Modified:
    trunk/Scribus/scribus/canvasgesture_resize.cpp
    trunk/Scribus/scribus/canvasmode_create.cpp
    trunk/Scribus/scribus/canvasmode_editarc.cpp

Modified: trunk/Scribus/scribus/canvasgesture_resize.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18666&path=/trunk/Scribus/scribus/canvasgesture_resize.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasgesture_resize.cpp (original)
+++ trunk/Scribus/scribus/canvasgesture_resize.cpp Wed Dec 25 12:05:14 2013
@@ -365,9 +365,6 @@
 			item->arcWidth += dw * dscw;
 			item->arcHeight += dh * dsch;
 			item->recalcPath();
-			FPoint tp2(getMinClipF(&currItem->PoLine));
-			currItem->PoLine.translate(-tp2.x(), -tp2.y());
-			m_doc->AdjustItemSize(currItem);
 		}
 		if (currItem->isSpiral())
 		{

Modified: trunk/Scribus/scribus/canvasmode_create.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18666&path=/trunk/Scribus/scribus/canvasmode_create.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_create.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_create.cpp Wed Dec 25 12:05:14 2013
@@ -710,7 +710,6 @@
 			z = m_doc->itemAddArea(PageItem::Arc, PageItem::Unspecified, Rxp, Ryp, m_doc->itemToolPrefs().shapeLineWidth, m_doc->itemToolPrefs().shapeFillColor, m_doc->itemToolPrefs().lineColor, true);
 		else
 			z = m_doc->itemAdd(PageItem::Arc, PageItem::Unspecified, Rxp, Ryp, Rxpd, Rypd, m_doc->itemToolPrefs().shapeLineWidth, m_doc->itemToolPrefs().shapeFillColor, m_doc->itemToolPrefs().lineColor, true);
-		m_doc->AdjustItemSize(m_doc->Items->at(z));
 		m_doc->setRedrawBounding(m_doc->Items->at(z));
 		break;
 	case modeDrawSpiral:

Modified: trunk/Scribus/scribus/canvasmode_editarc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18666&path=/trunk/Scribus/scribus/canvasmode_editarc.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editarc.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_editarc.cpp Wed Dec 25 12:05:14 2013
@@ -220,11 +220,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());
 	QTransform bb;
 	bb.scale(height / width, 1.0);
 	QLineF inp = QLineF(QPointF(width / 2.0, height / 2.0), QPointF(width, height / 2.0));
@@ -237,21 +232,34 @@
 	double nSweep = endAngle - startAngle;
 	if (nSweep < 0)
 		nSweep += 360;
+	double oldX = currItem->xPos();
+	double oldY = currItem->yPos();
+	FPointArray old = item->PoLine;
+	QPainterPath ppr;
+	ppr.moveTo(centerPoint.x() - width / 2.0, centerPoint.y() - height / 2.0);
+	ppr.lineTo(centerPoint.x() + width / 2.0, centerPoint.y() - height / 2.0);
+	ppr.lineTo(centerPoint.x() + width / 2.0, centerPoint.y() + height / 2.0);
+	ppr.lineTo(centerPoint.x() - width / 2.0, centerPoint.y() + height / 2.0);
+	ppr.closeSubpath();
+	currItem->PoLine.fromQPainterPath(ppr, true);
+	FPoint wh = getMaxClipF(&currItem->PoLine);
+	currItem->setWidthHeight(wh.x(),wh.y());
+	m_doc->AdjustItemSize(currItem);
+	currItem->OldB2 = currItem->width();
+	currItem->OldH2 = currItem->height();
 	QPainterPath pp;
-	pp.moveTo(mPoint);
-	pp.arcTo(QRectF(mPoint.x() - width / 2.0, mPoint.y() - height / 2.0, width, height), startAngle, nSweep);
+	pp.moveTo(width / 2.0, height / 2.0);
+	pp.arcTo(QRectF(0, 0, width, height), startAngle, nSweep);
 	pp.closeSubpath();
-	currItem->PoLine.fromQPainterPath(pp);
-	m_doc->AdjustItemSize(currItem);
+	currItem->PoLine.fromQPainterPath(pp, true);
 	if(UndoManager::undoEnabled())
 	{
 		ScItemState<QPair<FPointArray, FPointArray> > *ss = new ScItemState<QPair<FPointArray, FPointArray> >(Um::EditArc,"",Um::IPolygon);
-		FPointArray old = item->PoLine;
 		ss->set("ARC","arc");
 		ss->set("OLD_WIDTH",item->arcWidth);
 		ss->set("NEW_WIDTH",width);
-		ss->set("OLD_XPOS",item->xPos());
-		ss->set("OLD_YPOS",item->yPos());
+		ss->set("OLD_XPOS",oldX);
+		ss->set("OLD_YPOS",oldY);
 		ss->set("OLD_HEIGHT",item->arcHeight);
 		ss->set("NEW_HEIGHT",height);
 		ss->set("OLD_START",item->arcStartAngle);




More information about the scribus-commit mailing list