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

scribus-commit scribus-commit at lists.scribus.net
Mon Feb 1 08:27:22 CET 2010


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

Changeset: 
M  /branches/Version135/Scribus/scribus/canvasmode_normal.cpp
M  /branches/Version135/Scribus/scribus/pageitem.cpp
M  /branches/Version135/Scribus/scribus/pageitem.h

Diffs:
Index: scribus/pageitem.cpp
===================================================================
--- scribus/pageitem.cpp	(revision 14590)
+++ scribus/pageitem.cpp	(revision 14591)
@@ -4271,6 +4271,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/pageitem.h
===================================================================
--- scribus/pageitem.h	(revision 14590)
+++ scribus/pageitem.h	(revision 14591)
@@ -288,6 +288,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(QMatrix& mat) const;
 	QMatrix getTransform() const;
Index: scribus/canvasmode_normal.cpp
===================================================================
--- scribus/canvasmode_normal.cpp	(revision 14590)
+++ scribus/canvasmode_normal.cpp	(revision 14591)
@@ -925,7 +925,7 @@
 				QMatrix 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->LayerNr == m_doc->activeLayer()) && (!m_doc->layerLocked(docItem->LayerNr)))
 				if ((Sele.contains(apr2)) && (docItem->LayerNr == m_doc->activeLayer()) && (!m_doc->layerLocked(docItem->LayerNr)))
 				{




More information about the scribus-commit mailing list