r20215 by jghali - #13177: Changing Polygon Properties doesn't update canvas correctly

scribus-commit scribus-commit at lists.scribus.net
Fri Jun 26 23:00:14 UTC 2015


Author: jghali
Date: Fri Jun 26 23:00:14 2015
New Revision: 20215

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20215
Log:
#13177: Changing Polygon Properties doesn't update canvas correctly

Modified:
    trunk/Scribus/scribus/canvasmode_editpolygon.cpp

Modified: trunk/Scribus/scribus/canvasmode_editpolygon.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20215&path=/trunk/Scribus/scribus/canvasmode_editpolygon.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editpolygon.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_editpolygon.cpp Fri Jun 26 23:00:14 2015
@@ -243,13 +243,14 @@
 {
 	PageItem *currItem = m_doc->m_Selection->itemAt(0);
 	PageItem_RegularPolygon* item = currItem->asRegularPolygon();
+	QRectF oldRect = item->getBoundingRect();
 	polyCorners = polyC;
 	polyFactor = polyF;
 	polyRotation = polyR;
 	polyCurvature = polyCur;
 	polyInnerRot = polyIRot;
 	polyOuterCurvature = polyOCur;
-	if(UndoManager::undoEnabled())
+	if (UndoManager::undoEnabled())
 	{
 		SimpleState *ss = new SimpleState(Um::EditPolygon,"",Um::IPolygon);
 		ss->set("POLYGON","polygon");
@@ -280,7 +281,8 @@
 	updateFromItem();
 	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));
+	QRectF updateRect = oldRect.united(path.boundingRect());
+	m_doc->regionsChanged()->update(updateRect.adjusted(-5, -5, 10, 10));
 }
 
 double CanvasMode_EditPolygon::getUserValFromFactor(double factor)




More information about the scribus-commit mailing list