r16332 by fschmid - Fixed display issues during resizing items with the mouse.

scribus-commit scribus-commit at lists.scribus.net
Mon Jan 31 23:16:16 CET 2011


Author: fschmid
Date: Mon Jan 31 22:16:16 2011
New Revision: 16332

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=16332
Log:
Fixed display issues during resizing items with the mouse.

Modified:
    trunk/Scribus/scribus/canvasgesture_resize.cpp

Modified: trunk/Scribus/scribus/canvasgesture_resize.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16332&path=/trunk/Scribus/scribus/canvasgesture_resize.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasgesture_resize.cpp (original)
+++ trunk/Scribus/scribus/canvasgesture_resize.cpp Mon Jan 31 22:16:16 2011
@@ -111,7 +111,7 @@
 void ResizeGesture::drawControls(QPainter* p) 
 {
 	QColor drawColor = qApp->palette().color(QPalette::Active, QPalette::Highlight);
-	QRect localRect = m_canvas->canvasToLocal(m_bounds);
+	QRect localRect = m_canvas->canvasToLocal(m_bounds.normalized());
 	p->save();
 	//	p->setPen(QPen(Qt::black, 1, Qt::DashLine, Qt::FlatCap, Qt::MiterJoin));
 	//	p->drawRect(localRect);
@@ -132,12 +132,14 @@
 
 	if (m_origBounds != m_bounds)
 	{
+		QRectF n_bounds = m_bounds.normalized();
+		QRectF n_origBounds = m_origBounds.normalized();
 		p->save();
 //		p->translate(m_bounds.topLeft() - m_origBounds.topLeft());
-		drawOutline(p, qAbs(m_bounds.width()) / qMax(qAbs(m_origBounds.width()), static_cast<qreal>(1.0)), 
-					qAbs(m_bounds.height()) / qMax(qAbs(m_origBounds.height()), static_cast<qreal>(1.0)),
-					m_bounds.left() - m_origBounds.left(),
-					m_bounds.top() - m_origBounds.top());
+		drawOutline(p, qAbs(n_bounds.width()) / qMax(qAbs(n_origBounds.width()), static_cast<qreal>(1.0)), 
+					qAbs(n_bounds.height()) / qMax(qAbs(n_origBounds.height()), static_cast<qreal>(1.0)),
+					n_bounds.left() - n_origBounds.left(),
+					n_bounds.top() - n_origBounds.top());
 		p->restore();
 	}
 }




More information about the scribus-commit mailing list