r20044 by fschmid - Added a function to get the bounding box as a QRectF

scribus-commit scribus-commit at lists.scribus.net
Fri May 1 09:35:24 UTC 2015


Author: fschmid
Date: Fri May  1 09:35:24 2015
New Revision: 20044

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20044
Log:
Added a function to get the bounding box as a QRectF

Modified:
    trunk/Scribus/scribus/fpointarray.cpp
    trunk/Scribus/scribus/fpointarray.h

Modified: trunk/Scribus/scribus/fpointarray.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20044&path=/trunk/Scribus/scribus/fpointarray.cpp
==============================================================================
--- trunk/Scribus/scribus/fpointarray.cpp (original)
+++ trunk/Scribus/scribus/fpointarray.cpp Fri May  1 09:35:24 2015
@@ -33,6 +33,7 @@
 #include <QVector>
 
 #include "util.h"
+#include "util_math.h"
 #include "sclimits.h"
 
 using namespace std;
@@ -200,6 +201,12 @@
 	}
 }
 
+QRectF FPointArray::boundingRect()
+{
+	FPoint min = getMinClipF(this);
+	FPoint max = getMaxClipF(this);
+	return QRectF(QPointF(min.x(), min.y()), QPointF(max.x(), max.y()));
+}
 
 FPoint FPointArray::WidthHeight() const
 {

Modified: trunk/Scribus/scribus/fpointarray.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20044&path=/trunk/Scribus/scribus/fpointarray.h
==============================================================================
--- trunk/Scribus/scribus/fpointarray.h (original)
+++ trunk/Scribus/scribus/fpointarray.h Fri May  1 09:35:24 2015
@@ -59,6 +59,7 @@
 	QPointF pointQF(int i) const;
 	void translate( double dx, double dy );
 	void scale( double sx, double sy );
+	QRectF boundingRect();
 	FPoint WidthHeight() const;
 	void map(QTransform m);
 	FPointArray &operator=( const FPointArray &a );




More information about the scribus-commit mailing list