r21902 by jghali - fix sometime misplaced pattern object when launching symbol edit mode

scribus-commit scribus-commit at lists.scribus.net
Fri Apr 14 22:07:30 UTC 2017


Author: jghali
Date: Fri Apr 14 22:07:30 2017
New Revision: 21902

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21902
Log:
fix sometime misplaced pattern object when launching symbol edit mode

Modified:
    trunk/Scribus/scribus/scribusdoc.cpp

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21902&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp	(original)
+++ trunk/Scribus/scribus/scribusdoc.cpp	Fri Apr 14 22:07:30 2017
@@ -6578,7 +6578,8 @@
 			m_Selection->addItem(Items->at(as));
 			Items->at(as)->setLayer(layerID);
 		}
-		moveGroup(addedPage->xOffset(), addedPage->yOffset());
+		QRectF selRect = m_Selection->getVisualGroupRect();
+		moveGroup(addedPage->xOffset() - selRect.x(), addedPage->yOffset() - selRect.y());
 		if (Items->at(0)->isGroup())
 			Items->at(0)->asGroupFrame()->adjustXYPosition();
 		m_Selection->clear();
@@ -6660,9 +6661,10 @@
 			currItem->gXpos = currItem->xPos() - minx;
 			currItem->gYpos = currItem->yPos() - miny;
 			currItem->setXYPos(currItem->gXpos, currItem->gYpos, true);
-			docPatterns[m_currentEditedSymbol].pattern = currItem->DrawObj_toImage(qMin(qMax(maxx - minx, maxy - miny), 500.0));
-			docPatterns[m_currentEditedSymbol].width = maxx - minx;
-			docPatterns[m_currentEditedSymbol].height = maxy - miny;
+			ScPattern& currentEditedSymbol = docPatterns[m_currentEditedSymbol];
+			currentEditedSymbol.pattern = currItem->DrawObj_toImage(qMin(qMax(maxx - minx, maxy - miny), 500.0));
+			currentEditedSymbol.width  = maxx - minx;
+			currentEditedSymbol.height = maxy - miny;
 		}
 		if (m_ScMW->patternsDependingOnThis.count() > 1)
 		{




More information about the scribus-commit mailing list