r16146 by fschmid - Fixed Bug #9599: "can't select single group elements anymore"

scribus-commit scribus-commit at lists.scribus.net
Wed Dec 22 13:08:42 CET 2010


Author: fschmid
Date: Wed Dec 22 12:08:42 2010
New Revision: 16146

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=16146
Log:
Fixed Bug #9599: "can't select single group elements anymore"

Modified:
    trunk/Scribus/scribus/canvas.cpp
    trunk/Scribus/scribus/pageitem.cpp
    trunk/Scribus/scribus/pageitem.h
    trunk/Scribus/scribus/ui/propertiespalette.cpp

Modified: trunk/Scribus/scribus/canvas.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16146&path=/trunk/Scribus/scribus/canvas.cpp
==============================================================================
--- trunk/Scribus/scribus/canvas.cpp (original)
+++ trunk/Scribus/scribus/canvas.cpp Wed Dec 22 12:08:42 2010
@@ -488,20 +488,23 @@
 	while (currNr >= 0)
 	{
 		PageItem* embedded = group->groupItemList.at(currNr);
-		QPainterPath currPath(itemPos.map(QPointF(embedded->gXpos,embedded->gYpos)));
-		currPath.lineTo(itemPos.map(QPointF(embedded->width(), embedded->gYpos)));
+		QPainterPath currPath(itemPos.map(QPointF(0, 0)));
+		currPath.lineTo(itemPos.map(QPointF(embedded->width(), 0)));
 		currPath.lineTo(itemPos.map(QPointF(embedded->width(), embedded->height())));
-		currPath.lineTo(itemPos.map(QPointF(embedded->gXpos, embedded->height())));
+		currPath.lineTo(itemPos.map(QPointF(0, embedded->height())));
 		currPath.closeSubpath();
+		currPath.translate(embedded->gXpos, embedded->gYpos);
 		QPainterPath currClip;
 		currClip.addPolygon(itemPos.map(QPolygonF(embedded->Clip)));
 		currClip.closeSubpath();
+		currClip.translate(embedded->gXpos, embedded->gYpos);
 		if (currPath.intersects(mouseArea) || currClip.intersects(mouseArea))
 		{
 			if (embedded->isGroup())
 			{
 				QTransform itemPosG = itemPos;
-				itemPosG.translate(embedded->gXpos,embedded->gYpos);
+				QTransform eTrans = embedded->getGroupTransform();
+				itemPosG *= eTrans;
 				itemPosG.scale(group->width() / group->groupWidth, group->height() / group->groupHeight);
 				PageItem* ret = itemInGroup(embedded, itemPosG, mouseArea);
 				if (ret != NULL)

Modified: trunk/Scribus/scribus/pageitem.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16146&path=/trunk/Scribus/scribus/pageitem.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem.cpp (original)
+++ trunk/Scribus/scribus/pageitem.cpp Wed Dec 22 12:08:42 2010
@@ -5446,7 +5446,13 @@
 	FrameType = 2;
 }
 
-
+QTransform PageItem::getGroupTransform() const
+{
+	QTransform result;
+	result.translate(gXpos, gYpos);
+	result.rotate(Rot);
+	return result;
+}
 
 void PageItem::getTransform(QTransform& mat) const
 {

Modified: trunk/Scribus/scribus/pageitem.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16146&path=/trunk/Scribus/scribus/pageitem.h
==============================================================================
--- trunk/Scribus/scribus/pageitem.h (original)
+++ trunk/Scribus/scribus/pageitem.h Wed Dec 22 12:08:42 2010
@@ -315,6 +315,7 @@
 	QRectF getBoundingRect() const;
 	QRectF getCurrentBoundingRect(double moreSpace = 0.0) const;
 	QRectF getVisualBoundingRect() const;
+	QTransform getGroupTransform() const;
 	void getTransform(QTransform& mat) const;
 	QTransform getTransform() const;
 	/**

Modified: trunk/Scribus/scribus/ui/propertiespalette.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16146&path=/trunk/Scribus/scribus/ui/propertiespalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette.cpp (original)
+++ trunk/Scribus/scribus/ui/propertiespalette.cpp Wed Dec 22 12:08:42 2010
@@ -2264,15 +2264,15 @@
 	{
 		FlipH->setCheckable( false );
 		FlipV->setCheckable( false );
-		PageItem *i;
-		uint lowestItem = 999999;
-		for (int a=0; a<doc->m_Selection->count(); ++a)
-		{
-			i = doc->m_Selection->itemAt(a);
-			lowestItem = qMin(lowestItem, i->ItemNr);
-		}
-		i = doc->Items->at(lowestItem);
-		SetCurItem(i);
+//		PageItem *i;
+//		uint lowestItem = 999999;
+//		for (int a=0; a<doc->m_Selection->count(); ++a)
+//		{
+//			i = doc->m_Selection->itemAt(a);
+//			lowestItem = qMin(lowestItem, i->ItemNr);
+//		}
+//		i = doc->Items->at(lowestItem);
+		SetCurItem(doc->m_Selection->itemAt(0));
 	}
 }
 




More information about the scribus-commit mailing list