[Kst] extragear/graphics/kst/src/libkstapp

Andrew Walker arwalker at sumusltd.com
Thu Mar 30 01:51:36 CEST 2006


SVN commit 524207 by arwalker:

Do not allow rectangle to draw outside of its bounding box.

 M  +9 -1      kstviewbox.cpp  


--- trunk/extragear/graphics/kst/src/libkstapp/kstviewbox.cpp #524206:524207
@@ -101,7 +101,15 @@
     }
   }
 
-  const int bw(borderWidth() * p.lineWidthAdjustmentFactor());
+  // restrict the border width so we do not draw outside of the rectangle itself
+  int bw(borderWidth() * p.lineWidthAdjustmentFactor());
+  if (bw > _geom.width() / 2) {
+    bw = _geom.width() / 2;
+  }
+  if (bw > _geom.height()) {
+    bw = _geom.height() / 2;
+  }
+  
   QPen pen(borderColor(), bw);
   pen.setJoinStyle(_cornerStyle);
   if (bw == 0) {


More information about the Kst mailing list