r20057 by jghali - #12860: Windows > Outline may not set correctly document view importing pages

scribus-commit scribus-commit at lists.scribus.net
Wed May 6 22:00:15 UTC 2015


Author: jghali
Date: Wed May  6 22:00:15 2015
New Revision: 20057

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20057
Log:
#12860: Windows > Outline may not set correctly document view importing pages

Modified:
    trunk/Scribus/scribus/scribus.cpp

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20057&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Wed May  6 22:00:15 2015
@@ -6446,33 +6446,20 @@
 	if (!doc->m_Selection->isEmpty())
 	{
 		PageItem *currItem = doc->m_Selection->itemAt(0);
-	 	double rotation=currItem->rotation();
-		if ( rotation != 0.0 )
-		{
-			double MPI180=1.0/(180.0*M_PI);
-			double y1 = sin(rotation*MPI180) * currItem->width();
-			double x1 = cos(rotation*MPI180) * currItem->width();
-			double y2 = sin((rotation+90.0)*MPI180) * currItem->height();
-			double x2 = cos((rotation+90.0)*MPI180) * currItem->height();
-			double mx = currItem->xPos() + ((x1 + x2)/2.0);
-			double my = currItem->yPos() + ((y1 + y2)/2.0);
-			view->SetCCPo(mx, my);
-		}
-		else
-		{
-			double xOffset=0.0,yOffset=0.0;
-			switch (position)
-			{
-				case 1: //top left
-					break;
-				default: //center
-					xOffset = currItem->width() / 2.0;
-					yOffset = currItem->height() / 2.0;
-					break;
-			}
-
-			view->SetCCPo(currItem->xPos() + xOffset, currItem->yPos() + yOffset);
-		}
+		QTransform itemTrans = currItem->getTransform();
+		double xOffset=0.0,yOffset=0.0;
+		switch (position)
+		{
+			case 1: //top left
+				break;
+			default: //center
+				xOffset = currItem->width() / 2.0;
+				yOffset = currItem->height() / 2.0;
+				break;
+		}
+
+		QPointF point = itemTrans.map(QPointF(xOffset, yOffset));
+		view->SetCCPo(point.x(), point.y());
 	}
 }
 




More information about the scribus-commit mailing list