Bug 118678 - Ellipse drawn incorrectly when border width is zero
Summary: Ellipse drawn incorrectly when border width is zero
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: general (show other bugs)
Version: 1.x
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-20 01:18 UTC by Andrew Walker
Modified: 2005-12-20 01:48 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Walker 2005-12-20 01:18:19 UTC
Version:           HEAD (using KDE KDE 3.4.0)
OS:                Linux

PROBLEM:
When an ellipse is drawn with a Border width of zero the border is clipped at the right and bottom of the ellipse

STEPS TO REPRODUCE:
Create a new ellipse
Enter layout mode
Double click on the object to launch the Edit Ellipse dialog
Set the Border width to zero
Hit OK

EXPECTED RESULTS:
A complete ellipse is drawn

RESULTS:
An ellipse with the border clipped at the right and bottom edge is drawn
Comment 1 George Staikos 2005-12-20 01:48:45 UTC
SVN commit 489872 by staikos:

QPainter::drawEllipse doesn't seem to work with 0-width pen 
BUG: 118678


 M  +3 -3      kstviewellipse.cpp  


--- trunk/extragear/graphics/kst/kst/kstviewellipse.cpp #489871:489872
@@ -27,7 +27,7 @@
 #include <qvariant.h>
 
 KstViewEllipse::KstViewEllipse()
-: KstViewObject("Ellipse"), _borderWidth(0) {
+: KstViewObject("Ellipse"), _borderWidth(1) {
   setTransparent(true);
   _transparentFill = false;
 }
@@ -111,7 +111,7 @@
 
 void KstViewEllipse::setBorderWidth(int width) {
   if (_borderWidth != width) {
-    _borderWidth = width;
+    _borderWidth = kMax(1, width);
     setDirty();
   }
 }
@@ -143,7 +143,7 @@
   } else if (propertyName == "borderWidth") {
     map.insert(QString("_kst_widgetType"), QString("QSpinBox"));
     map.insert(QString("_kst_label"), i18n("Border width"));    
-    map.insert(QString("minValue"), 0);
+    map.insert(QString("minValue"), 1);
   } else if (propertyName == "fillColor") {
     map.insert(QString("_kst_widgetType"), QString("KColorButton"));
     map.insert(QString("_kst_label"), i18n("Fill Color"));