r23414 by jghali - Fix some canvas update issues when changing start/end arrows

scribus-commit scribus-commit at lists.scribus.net
Tue Dec 10 08:35:00 UTC 2019


Author: jghali
Date: Tue Dec 10 08:35:00 2019
New Revision: 23414

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23414
Log:
Fix some canvas update issues when changing start/end arrows

Modified:
    trunk/Scribus/scribus/scribusdoc.cpp

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23414&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp	(original)
+++ trunk/Scribus/scribus/scribusdoc.cpp	Tue Dec 10 08:35:00 2019
@@ -13780,6 +13780,9 @@
 	if (selectedItemCount == 0)
 		return;
 
+	if ((startArrowID < 0) && (endArrowID < 0))
+		return;
+
 	UndoTransaction activeTransaction;
 	m_updateManager.setUpdatesDisabled();
 	if (UndoManager::undoEnabled() && selectedItemCount > 1)
@@ -13787,24 +13790,32 @@
 	QString tooltip = Um::ItemsInvolved + "\n";
 	if (selectedItemCount > Um::ItemsInvolvedLimit)
 		tooltip = Um::ItemsInvolved2 + "\n";
+
+	QRectF updateRect;
 	for (int i = 0; i < selectedItemCount; ++i)
 	{
 		PageItem *currItem = itemSelection->itemAt(i);
 		if (!(currItem->asLine() || currItem->asPolyLine() || currItem->asSpiral()))
 			continue;
+		updateRect = updateRect.united(currItem->getBoundingRect());
 		if (startArrowID != -1)
 			currItem->setStartArrowIndex(startArrowID);
 		if (endArrowID != -1)
 			currItem->setEndArrowIndex(endArrowID);
+		updateRect = updateRect.united(currItem->getBoundingRect());
 		if (selectedItemCount <= Um::ItemsInvolvedLimit)
 			tooltip += "\t" + currItem->getUName() + "\n";
-		currItem->update();
-	}
+		//currItem->update();
+	}
+
+	if (!updateRect.isEmpty())
+		regionsChanged()->update(updateRect);
+
 	QString undoText;
 	if (startArrowID!=-1 && endArrowID!=-1)
-		undoText=Um::StartAndEndArrow;
+		undoText = Um::StartAndEndArrow;
 	else
-		undoText=(startArrowID!=-1) ? Um::StartArrow : Um::EndArrow;
+		undoText = (startArrowID != -1) ? Um::StartArrow : Um::EndArrow;
 	if (activeTransaction)
 	{
 		activeTransaction.commit(Um::Selection,




More information about the scribus-commit mailing list