r16293 by fschmid - Allow normal resizing of Arc items, this time for the resizing with the properties palette.

scribus-commit scribus-commit at lists.scribus.net
Sat Jan 22 11:15:39 CET 2011


Author: fschmid
Date: Sat Jan 22 10:15:39 2011
New Revision: 16293

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=16293
Log:
Allow normal resizing of Arc items, this time for the resizing with the properties palette.

Modified:
    trunk/Scribus/scribus/ui/propertiespalette.cpp

Modified: trunk/Scribus/scribus/ui/propertiespalette.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16293&path=/trunk/Scribus/scribus/ui/propertiespalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette.cpp (original)
+++ trunk/Scribus/scribus/ui/propertiespalette.cpp Sat Jan 22 10:15:39 2011
@@ -3124,6 +3124,8 @@
 	y = Ypos->value() / m_unitRatio;
 	w = Width->value() / m_unitRatio;
 	h = Height->value() / m_unitRatio;
+	double oldW = (CurItem->width() != 0.0) ? CurItem->width() : 1.0;
+	double oldH = (CurItem->height() != 0.0) ? CurItem->height() : 1.0;
 	if (doc->m_Selection->isMultipleSelection())
 	{
 		if (!_userActionOn)
@@ -3163,7 +3165,6 @@
 		}
 		else
 		{
-			double oldW = (CurItem->width() != 0.0) ? CurItem->width() : 1.0;
 			if (CurItem->isTableItem)
 			{
 				int rmo = doc->RotMode();
@@ -3213,6 +3214,20 @@
 					doc->SizeItem(w, CurItem->height(), CurItem, true, true, false);
 			}
 		}
+		if (CurItem->isArc())
+		{
+			double dw = w - oldW;
+			double dh = h - oldH;
+			PageItem_Arc* item = CurItem->asArc();
+			double dsch = item->arcHeight / oldH;
+			double dscw = item->arcWidth / oldW;
+			item->arcWidth += dw * dscw;
+			item->arcHeight += dh * dsch;
+			item->recalcPath();
+			FPoint tp2(getMinClipF(&CurItem->PoLine));
+			CurItem->PoLine.translate(-tp2.x(), -tp2.y());
+			doc->AdjustItemSize(CurItem);
+		}
 		CurItem->Sizing = oldS;
 	}
 	emit DocChanged();
@@ -3225,6 +3240,8 @@
 		return;
 	if ((HaveDoc) && (HaveItem))
 	{
+		double oldW = (CurItem->width() != 0.0) ? CurItem->width() : 1.0;
+		double oldH = (CurItem->height() != 0.0) ? CurItem->height() : 1.0;
 		double x,y,w,h, gx, gy, gh, gw;
 		x = Xpos->value() / m_unitRatio;
 		y = Ypos->value() / m_unitRatio;
@@ -3269,7 +3286,6 @@
 			}
 			else
 			{
-				double oldH = (CurItem->height() != 0.0) ? CurItem->height() : 1.0;
 				if (CurItem->isTableItem)
 				{
 					int rmo = doc->RotMode();
@@ -3320,6 +3336,20 @@
 				}
 			}
 			CurItem->Sizing = oldS;
+		}
+		if (CurItem->isArc())
+		{
+			double dw = w - oldW;
+			double dh = h - oldH;
+			PageItem_Arc* item = CurItem->asArc();
+			double dsch = item->arcHeight / oldH;
+			double dscw = item->arcWidth / oldW;
+			item->arcWidth += dw * dscw;
+			item->arcHeight += dh * dsch;
+			item->recalcPath();
+			FPoint tp2(getMinClipF(&CurItem->PoLine));
+			CurItem->PoLine.translate(-tp2.x(), -tp2.y());
+			doc->AdjustItemSize(CurItem);
 		}
 		emit DocChanged();
 		doc->regionsChanged()->update(QRect());




More information about the scribus-commit mailing list