[Kst] [Bug 143805] Ellipse object does not correctly limit border	width
    Andrew Walker 
    arwalker at sumusltd.com
       
    Thu Apr 12 19:34:52 CEST 2007
    
    
  
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=143805         
arwalker sumusltd com changed:
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
------- Additional Comments From arwalker sumusltd com  2007-04-12 19:34 -------
SVN commit 653120 by arwalker:
BUG:143805 Limit the border width of an ellipse so it doesn't extend beyond its own edge
 M  +10 -3     kstviewellipse.cpp  
--- branches/work/kst/1.5/kst/src/libkstapp/kstviewellipse.cpp #653119:653120
 @ -95,15 +95,22  @
     }
   }
 
-  const int bw(_borderWidth * p.lineWidthAdjustmentFactor());
+  const QRect g(geometry());
+  int bw(_borderWidth * p.lineWidthAdjustmentFactor());
+  if (bw > g.width()/2) {
+    bw = g.width()/2;
+  }
+  if (bw > g.height()/2) {
+    bw = g.height()/2;
+  }
   QPen pen(bw > 0 ? _borderColor : _foregroundColor, bw);
   p.setPen(pen);
   if (_transparentFill) {
-    p.setBrush(Qt::NoBrush);  
+    p.setBrush(Qt::NoBrush);
   } else {
     p.setBrush(_foregroundColor);
   }
-  const QRect g(geometry());
+
   p.drawEllipse(g.x() + bw/2, g.y() + bw/2, g.width() - bw, g.height() - bw);
   p.restore();
 }
    
    
More information about the Kst
mailing list