r18981 by fschmid - Fixed Bug #12177: Changing Arc height/witdh places the Arc out of the Frame

scribus-commit scribus-commit at lists.scribus.net
Wed Apr 2 18:59:01 UTC 2014


Author: fschmid
Date: Wed Apr  2 18:59:00 2014
New Revision: 18981

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18981
Log:
Fixed Bug #12177: Changing Arc height/witdh places the Arc out of the Frame

Modified:
    trunk/Scribus/scribus/canvasmode_editarc.cpp
    trunk/Scribus/scribus/ui/arcvectorbase.ui

Modified: trunk/Scribus/scribus/canvasmode_editarc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18981&path=/trunk/Scribus/scribus/canvasmode_editarc.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editarc.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_editarc.cpp Wed Apr  2 18:59:00 2014
@@ -332,30 +332,33 @@
 			nSweep += 360;
 		double nWidth = sPoint.x() - widthPoint.x();
 		double nHeight = sPoint.y() - heightPoint.y();
-		pp.moveTo(sPoint);
-		pp.arcTo(QRectF(sPoint.x() - nWidth, sPoint.y() - nHeight, nWidth * 2, nHeight * 2), startAngle, nSweep);
-		pp.closeSubpath();
-		FPointArray ar;
-		ar.fromQPainterPath(pp);
-		if (m_arcPoint == useControlStart)
+		if ((nWidth > 0) && (nHeight > 0))
 		{
-			startPoint = ar.pointQF(2);
-			QLineF stLinA = QLineF(smPoint, itemMatrix.map(startPoint));
-			m_canvas->displayRotHUD(m->globalPos(), 360.0 - stLinA.angle());
+			pp.moveTo(sPoint);
+			pp.arcTo(QRectF(sPoint.x() - nWidth, sPoint.y() - nHeight, nWidth * 2, nHeight * 2), startAngle, nSweep);
+			pp.closeSubpath();
+			FPointArray ar;
+			ar.fromQPainterPath(pp);
+			if (m_arcPoint == useControlStart)
+			{
+				startPoint = ar.pointQF(2);
+				QLineF stLinA = QLineF(smPoint, itemMatrix.map(startPoint));
+				m_canvas->displayRotHUD(m->globalPos(), 360.0 - stLinA.angle());
+			}
+			else if (m_arcPoint == useControlSweep)
+			{
+				endPoint = ar.pointQF(ar.size() - 4);
+				QLineF stLinA = QLineF(smPoint, itemMatrix.map(endPoint));
+				m_canvas->displayRotHUD(m->globalPos(), 360.0 - stLinA.angle());
+			}
+			QLineF res = QLineF(centerPoint, startPoint);
+			QLineF swe = QLineF(centerPoint, endPoint);
+			VectorDialog->setValues(res.angle(), swe.angle(), nHeight * 2, nWidth * 2);
+			blockUpdateFromItem(true);
+			currItem->update();
+			blockUpdateFromItem(false);
+			m_doc->regionsChanged()->update(itemMatrix.mapRect(QRectF(0, 0, currItem->width(), currItem->height())).adjusted(-currItem->width() / 2.0, -currItem->height() / 2.0, currItem->width(), currItem->height()));
 		}
-		else if (m_arcPoint == useControlSweep)
-		{
-			endPoint = ar.pointQF(ar.size() - 4);
-			QLineF stLinA = QLineF(smPoint, itemMatrix.map(endPoint));
-			m_canvas->displayRotHUD(m->globalPos(), 360.0 - stLinA.angle());
-		}
-		QLineF res = QLineF(centerPoint, startPoint);
-		QLineF swe = QLineF(centerPoint, endPoint);
-		VectorDialog->setValues(res.angle(), swe.angle(), nHeight * 2, nWidth * 2);
-		blockUpdateFromItem(true);
-		currItem->update();
-		blockUpdateFromItem(false);
-		m_doc->regionsChanged()->update(itemMatrix.mapRect(QRectF(0, 0, currItem->width(), currItem->height())).adjusted(-currItem->width() / 2.0, -currItem->height() / 2.0, currItem->width(), currItem->height()));
 	}
 	Mxp = newX;
 	Myp = newY;

Modified: trunk/Scribus/scribus/ui/arcvectorbase.ui
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18981&path=/trunk/Scribus/scribus/ui/arcvectorbase.ui
==============================================================================
--- trunk/Scribus/scribus/ui/arcvectorbase.ui (original)
+++ trunk/Scribus/scribus/ui/arcvectorbase.ui Wed Apr  2 18:59:00 2014
@@ -10,7 +10,7 @@
     <x>0</x>
     <y>0</y>
     <width>176</width>
-    <height>147</height>
+    <height>153</height>
    </rect>
   </property>
   <property name="minimumSize">
@@ -77,6 +77,9 @@
        <property name="decimals">
         <number>1</number>
        </property>
+       <property name="minimum">
+        <double>1.000000000000000</double>
+       </property>
        <property name="maximum">
         <double>99999.000000000000000</double>
        </property>
@@ -93,6 +96,9 @@
       <widget class="ScrSpinBox" name="arcWidth">
        <property name="decimals">
         <number>1</number>
+       </property>
+       <property name="minimum">
+        <double>1.000000000000000</double>
        </property>
        <property name="maximum">
         <double>99999.000000000000000</double>




More information about the scribus-commit mailing list