r21270 by fschmid -

scribus-commit scribus-commit at lists.scribus.net
Sun May 1 16:12:23 UTC 2016


Author: fschmid
Date: Sun May  1 16:12:22 2016
New Revision: 21270

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21270
Log:
Improve drawing of object oulines (relates to Bug #14005)

Modified:
    trunk/Scribus/scribus/canvas.cpp
    trunk/Scribus/scribus/canvas.h
    trunk/Scribus/scribus/canvasgesture_resize.cpp
    trunk/Scribus/scribus/canvasmode.cpp

Modified: trunk/Scribus/scribus/canvas.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21270&path=/trunk/Scribus/scribus/canvas.cpp
==============================================================================
--- trunk/Scribus/scribus/canvas.cpp	(original)
+++ trunk/Scribus/scribus/canvas.cpp	Sun May  1 16:12:22 2016
@@ -202,6 +202,14 @@
 				  qRound((p.y() - m_doc->minCanvasCoordinate.y()) * m_viewMode.scale),
 				  qRound(p.width() * m_viewMode.scale), 
 				  qRound(p.height() * m_viewMode.scale));
+}
+
+QRectF Canvas::canvasToLocalF(QRectF p) const
+{
+	return 	QRectF((p.x() - m_doc->minCanvasCoordinate.x()) * m_viewMode.scale,
+				  (p.y() - m_doc->minCanvasCoordinate.y()) * m_viewMode.scale,
+				  p.width() * m_viewMode.scale,
+				  p.height() * m_viewMode.scale);
 }
 
 

Modified: trunk/Scribus/scribus/canvas.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21270&path=/trunk/Scribus/scribus/canvas.h
==============================================================================
--- trunk/Scribus/scribus/canvas.h	(original)
+++ trunk/Scribus/scribus/canvas.h	Sun May  1 16:12:22 2016
@@ -155,6 +155,7 @@
 	QPoint canvasToLocal(QPointF p) const;
 	QPoint canvasToGlobal(QPointF p) const;
 	QRect canvasToLocal(QRectF p) const;
+	QRectF canvasToLocalF(QRectF p) const;
 	QRect canvasToGlobal(QRectF p) const;
 	FPoint localToCanvas(QPoint p) const;
 //	FPoint localToCanvas(QPointF p) const;

Modified: trunk/Scribus/scribus/canvasgesture_resize.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21270&path=/trunk/Scribus/scribus/canvasgesture_resize.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasgesture_resize.cpp	(original)
+++ trunk/Scribus/scribus/canvasgesture_resize.cpp	Sun May  1 16:12:22 2016
@@ -131,7 +131,7 @@
 void ResizeGesture::drawControls(QPainter* p) 
 {
 	QColor drawColor = qApp->palette().color(QPalette::Active, QPalette::Highlight);
-	QRect localRect;
+	QRectF localRect;
 	switch (m_handle)
 	{
 		case Canvas::NORTHWEST:
@@ -162,7 +162,7 @@
 			break;
 	}
 	if (m_doc->m_Selection->isMultipleSelection())
-		localRect = m_canvas->canvasToLocal(m_bounds.normalized());
+		localRect = m_canvas->canvasToLocalF(m_bounds.normalized());
 	p->save();
 	if (m_rotation != 0)
 	{
@@ -201,8 +201,10 @@
 					m.scale(1, -1);
 				}
 			}
-			QPolygon clip = m.map(currItem->Clip);
-			currItem->DrawPolyL(p, clip);
+			QPainterPath clip = m.map(currItem->PoLine.toQPainterPath(false));
+			p->drawPath(clip);
+		//	QPolygon clip = m.map(currItem->Clip);
+		//	currItem->DrawPolyL(p, clip);
 		}
 		else if (m_doc->m_Selection->isMultipleSelection())
 		{
@@ -226,8 +228,10 @@
 					m.scale(scx, scy);
 					if (currItem->rotation() != 0)
 						m.rotate(currItem->rotation());
-					QPolygon clip = m.map(currItem->Clip);
-					currItem->DrawPolyL(p, clip);
+					QPainterPath clip = m.map(currItem->PoLine.toQPainterPath(false));
+					p->drawPath(clip);
+				//	QPolygon clip = m.map(currItem->Clip);
+				//	currItem->DrawPolyL(p, clip);
 				}
 			}
 		}

Modified: trunk/Scribus/scribus/canvasmode.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21270&path=/trunk/Scribus/scribus/canvasmode.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode.cpp	(original)
+++ trunk/Scribus/scribus/canvasmode.cpp	Sun May  1 16:12:22 2016
@@ -519,7 +519,8 @@
 			}
 			p->scale(scalex * m_scaleX, scaley * m_scaleY);
 			p->translate(addTransX, 0);
-			currItem->DrawPolyL(p, currItem->Clip);
+			p->drawPath(currItem->PoLine.toQPainterPath(false));
+		//	currItem->DrawPolyL(p, currItem->Clip);
 		}
 		else // moving page item
 		{




More information about the scribus-commit mailing list