[Kst] branches/work/kst/1.5/kst/src/libkstapp

Andrew Walker arwalker at sumusltd.com
Thu Apr 12 19:24:12 CEST 2007


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