r14592 by jghali - #8752 : drag select not accurate at high zoom level

scribus-commit scribus-commit at lists.scribus.net
Mon Feb 1 11:37:42 CET 2010


Revision: 14592
Author: jghali
Date: 2010-01-29T23:20:42.961580Z
Commit message: #8752 : drag select not accurate at high zoom level

Changeset: 
M  /trunk/Scribus/scribus/canvasmode_normal.cpp
M  /trunk/Scribus/scribus/pageitem.cpp
M  /trunk/Scribus/scribus/pageitem.h

Diffs:
Index: scribus/pageitem.h
===================================================================
--- scribus/pageitem.h	(revision 14591)
+++ scribus/pageitem.h	(revision 14592)
@@ -304,6 +304,7 @@
 	void getBoundingRect(double *x1, double *y1, double *x2, double *y2) const;
 	void getVisualBoundingRect(double *x1, double *y1, double *x2, double *y2) const;
 	QRectF getBoundingRect() const;
+	QRectF getCurrentBoundingRect(double moreSpace = 0.0) const;
 	QRectF getVisualBoundingRect() const;
 	void getTransform(QTransform& mat) const;
 	QTransform getTransform() const;
Index: scribus/pageitem.cpp
===================================================================
--- scribus/pageitem.cpp	(revision 14591)
+++ scribus/pageitem.cpp	(revision 14592)
@@ -4839,6 +4839,16 @@
 	return QRectF(x,y,x2-x,y2-y);
 }
 
+QRectF PageItem::getCurrentBoundingRect(double moreSpace) const
+{
+	double x = BoundingX - moreSpace / 2.0;
+	double y = BoundingY - moreSpace / 2.0;
+	double w = BoundingW + moreSpace;
+	double h = BoundingH + moreSpace;
+	QRectF ret = QRectF(x, y, w, h);
+	return ret;
+}
+
 QRectF PageItem::getVisualBoundingRect() const
 {
 	double x,y,x2,y2;
Index: scribus/canvasmode_normal.cpp
===================================================================
--- scribus/canvasmode_normal.cpp	(revision 14591)
+++ scribus/canvasmode_normal.cpp	(revision 14592)
@@ -925,7 +925,7 @@
 				QTransform p;
 				m_canvas->Transform(docItem, p);
 			//	QRegion apr = QRegion(docItem->Clip * p);
-				QRect apr2(docItem->getRedrawBounding(m_canvas->scale()));
+				QRect  apr2 = m_canvas->canvasToLocal( docItem->getCurrentBoundingRect(docItem->lineWidth()) );
 			//	if (((Sele.contains(apr.boundingRect())) || (Sele.contains(apr2))) && (docItem->LayerID == m_doc->activeLayer()) && (!m_doc->layerLocked(docItem->LayerID)))
 				if ((Sele.contains(apr2)) && (docItem->LayerID == m_doc->activeLayer()) && (!m_doc->layerLocked(docItem->LayerID)))
 				{




More information about the scribus-commit mailing list