r16974 by fschmid - Final fix for Bug 10337: "In "points" (shape) edit palette : points moved with arrows become invisible"

scribus-commit scribus-commit at lists.scribus.net
Mon Nov 14 12:40:26 UTC 2011


Author: fschmid
Date: Mon Nov 14 12:40:25 2011
New Revision: 16974

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=16974
Log:
Final fix for Bug 10337: "In "points" (shape) edit palette : points moved with arrows become invisible"

Modified:
    trunk/Scribus/scribus/canvasmode.cpp
    trunk/Scribus/scribus/canvasmode_nodeedit.cpp

Modified: trunk/Scribus/scribus/canvasmode.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16974&path=/trunk/Scribus/scribus/canvasmode.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode.cpp (original)
+++ trunk/Scribus/scribus/canvasmode.cpp Mon Nov 14 12:40:25 2011
@@ -1192,6 +1192,7 @@
 							int storedClRe = m_doc->nodeEdit.ClRe;
 							if ((m_doc->nodeEdit.SelNode.count() != 0) && (m_doc->nodeEdit.EdPoints))
 							{
+								QPolygonF poly;
 								if ((currItem->imageFlippedH()) && (currItem->isSymbol() || currItem->isGroup()))
 									moveBy *= -1;
 								for (int itm = 0; itm < m_doc->nodeEdit.SelNode.count(); ++itm)
@@ -1205,8 +1206,13 @@
 									m_doc->nodeEdit.ClRe = clRe;
 									np = np - FPoint(moveBy, 0);
 									m_doc->nodeEdit.moveClipPoint(currItem, np);
-									m_doc->regionsChanged()->update(QRectF());
+									poly.append(np.toQPointF());
 								}
+								QTransform m = currItem->getTransform();
+								poly = m.map(poly);
+								QRectF oldR = poly.boundingRect().adjusted(-5, -5, 10, 10);
+								QRectF newR(currItem->getBoundingRect());
+								m_doc->regionsChanged()->update(newR.unite(oldR));
 							}
 							m_doc->nodeEdit.ClRe = storedClRe;
 						}
@@ -1257,6 +1263,7 @@
 							int storedClRe = m_doc->nodeEdit.ClRe;
 							if ((m_doc->nodeEdit.SelNode.count() != 0) && (m_doc->nodeEdit.EdPoints))
 							{
+								QPolygonF poly;
 								if ((currItem->imageFlippedH()) && (currItem->isSymbol() || currItem->isGroup()))
 									moveBy *= -1;
 								for (int itm = 0; itm < m_doc->nodeEdit.SelNode.count(); ++itm)
@@ -1270,8 +1277,13 @@
 									m_doc->nodeEdit.ClRe = clRe;
 									np = np + FPoint(moveBy, 0);
 									m_doc->nodeEdit.moveClipPoint(currItem, np);
-									m_doc->regionsChanged()->update(QRectF());
+									poly.append(np.toQPointF());
 								}
+								QTransform m = currItem->getTransform();
+								poly = m.map(poly);
+								QRectF oldR = poly.boundingRect().adjusted(-5, -5, 10, 10);
+								QRectF newR(currItem->getBoundingRect());
+								m_doc->regionsChanged()->update(newR.unite(oldR));
 							}
 							m_doc->nodeEdit.ClRe = storedClRe;
 						}
@@ -1322,6 +1334,7 @@
 							int storedClRe = m_doc->nodeEdit.ClRe;
 							if ((m_doc->nodeEdit.SelNode.count() != 0) && (m_doc->nodeEdit.EdPoints))
 							{
+								QPolygonF poly;
 								if ((currItem->imageFlippedV()) && (currItem->isSymbol() || currItem->isGroup()))
 									moveBy *= -1;
 								for (int itm = 0; itm < m_doc->nodeEdit.SelNode.count(); ++itm)
@@ -1335,8 +1348,13 @@
 									m_doc->nodeEdit.ClRe = clRe;
 									np = np - FPoint(0, moveBy);
 									m_doc->nodeEdit.moveClipPoint(currItem, np);
-									m_doc->regionsChanged()->update(QRectF());
+									poly.append(np.toQPointF());
 								}
+								QTransform m = currItem->getTransform();
+								poly = m.map(poly);
+								QRectF oldR = poly.boundingRect().adjusted(-5, -5, 10, 10);
+								QRectF newR(currItem->getBoundingRect());
+								m_doc->regionsChanged()->update(newR.unite(oldR));
 							}
 							m_doc->nodeEdit.ClRe = storedClRe;
 						}
@@ -1387,6 +1405,7 @@
 							int storedClRe = m_doc->nodeEdit.ClRe;
 							if ((m_doc->nodeEdit.SelNode.count() != 0) && (m_doc->nodeEdit.EdPoints))
 							{
+								QPolygonF poly;
 								if ((currItem->imageFlippedV()) && (currItem->isSymbol() || currItem->isGroup()))
 									moveBy *= -1;
 								for (int itm = 0; itm < m_doc->nodeEdit.SelNode.count(); ++itm)
@@ -1400,8 +1419,13 @@
 									m_doc->nodeEdit.ClRe = clRe;
 									np = np - FPoint(0, -moveBy);
 									m_doc->nodeEdit.moveClipPoint(currItem, np);
-									m_doc->regionsChanged()->update(QRectF());
+									poly.append(np.toQPointF());
 								}
+								QTransform m = currItem->getTransform();
+								poly = m.map(poly);
+								QRectF oldR = poly.boundingRect().adjusted(-5, -5, 10, 10);
+								QRectF newR(currItem->getBoundingRect());
+								m_doc->regionsChanged()->update(newR.unite(oldR));
 							}
 							m_doc->nodeEdit.ClRe = storedClRe;
 						}

Modified: trunk/Scribus/scribus/canvasmode_nodeedit.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16974&path=/trunk/Scribus/scribus/canvasmode_nodeedit.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_nodeedit.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_nodeedit.cpp Mon Nov 14 12:40:25 2011
@@ -182,12 +182,26 @@
 			Clip = currItem->ContourLine;
 		else
 			Clip = currItem->PoLine;
+		QTransform pm2 = currItem->getTransform();
+		if (currItem->isSymbol() || currItem->isGroup())
+		{
+			if (currItem->imageFlippedH())
+			{
+				pm2.translate(currItem->width(), 0);
+				pm2.scale(-1, 1);
+			}
+			if (currItem->imageFlippedV())
+			{
+				pm2.translate(0, currItem->height());
+				pm2.scale(1, -1);
+			}
+		}
 		for (uint a = 0; a < Clip.size(); ++a)
 		{
 			if (Clip.point(a).x() > 900000)
 				continue;
 			FPoint np = Clip.point(a);
-			FPoint npf2 = np.transformPoint(currItem->xPos(), currItem->yPos(), currItem->rotation(), 1.0, 1.0, false);
+			FPoint npf2 = np.transformPoint(pm2, false);
 			if ((Sele.contains(npf2.x(), npf2.y())) && ((a == 0) || (((a-2) % 4) == 0)))
 			{
 				if (a == 0)




More information about the scribus-commit mailing list