r20585 by jghali -

scribus-commit scribus-commit at lists.scribus.net
Thu Nov 26 19:26:23 UTC 2015


Author: jghali
Date: Thu Nov 26 19:26:23 2015
New Revision: 20585

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20585
Log:
#13563: Resizing 2 items (one of which is rotated) leads to wrong canvas placement
This is not a complete fix, but seriously improve the situation. Still issues especially with spiral objects.
Wondering also why there is so much ifs related to the item type in the modified function...

Modified:
    trunk/Scribus/scribus/scribusdoc.cpp

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20585&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp	(original)
+++ trunk/Scribus/scribus/scribusdoc.cpp	Thu Nov 26 19:26:23 2015
@@ -15008,20 +15008,28 @@
 			}
 			else
 				AdjustItemSize(bb, true, false);
-			QTransform ma3;
-			ma3.translate(gx, gy);
-			ma3.scale(scx, scy);
-			FPoint n(gx-oldPos.x(), gy-oldPos.y());
-		//	x = ma3.m11() * n.x() + ma3.m21() * n.y() + ma3.dx();
-		//	y = ma3.m22() * n.y() + ma3.m12() * n.x() + ma3.dy();
-		//	MoveItem(gx-x, gy-y, bb);
-			bb->setXYPos(b1.x()+gx, b1.y()+gy);
+			if (bb->isArc() || bb->isSpiral() || bb->isRegularPolygon())
+				bb->setXYPos(b1.x() + gx, b1.y() + gy);
+			else
+			{
+				QTransform ma3;
+				ma3.translate(gx, gy);
+				ma3.scale(scx, scy);
+				FPoint n(gx-oldPos.x(), gy-oldPos.y());
+				double x = ma3.m11() * n.x() + ma3.m21() * n.y() + ma3.dx();
+				double y = ma3.m22() * n.y() + ma3.m12() * n.x() + ma3.dy();
+				//MoveItem(gx-x, gy-y, bb);
+				bb->moveBy(gx - x, gy - y);
+			}
 			if (oldRot != 0)
 			{
 				bb->setRotation(atan2(t1.y()-b1.y(),t1.x()-b1.x())*(180.0/M_PI));
-				QTransform ma;
-				ma.rotate(-bb->rotation());
-				bb->PoLine.map(ma);
+				if (!bb->isArc() && !bb->isSpiral() && !bb->isRegularPolygon())
+				{
+					QTransform ma;
+					ma.rotate(-bb->rotation());
+					bb->PoLine.map(ma);
+				}
 				if (bb->isGroup() || bb->isSymbol())
 				{
 					double oldGW = bb->groupWidth;




More information about the scribus-commit mailing list