r16511 by craig - #9728: Fix crash when drawing a circle

scribus-commit scribus-commit at lists.scribus.net
Fri Mar 25 23:57:13 CET 2011


Author: craig
Date: Fri Mar 25 22:57:13 2011
New Revision: 16511

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=16511
Log:
#9728: Fix crash when drawing a circle

Modified:
    trunk/Scribus/scribus/canvasmode_create.cpp

Modified: trunk/Scribus/scribus/canvasmode_create.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16511&path=/trunk/Scribus/scribus/canvasmode_create.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_create.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_create.cpp Fri Mar 25 22:57:13 2011
@@ -81,9 +81,10 @@
 
 	if (createObjectMode != modeDrawLine)
 	{
-		QRectF  bounds = QRectF(topLeft, btRight).normalized();
-		QRect   localRect = m_canvas->canvasToLocal(bounds);
-
+		QRectF bounds = QRectF(topLeft, btRight).normalized();
+		QRect localRect = m_canvas->canvasToLocal(bounds);
+		if (localRect.width() <= 0 || localRect.height() <= 0)
+			return;
 		p->setRenderHint(QPainter::Antialiasing);
 
 		p->save();




More information about the scribus-commit mailing list