[Kst] kdeextragear-2/kst/kst

Andrew Walker arwalker at sumusltd.com
Tue Dec 14 19:50:15 CET 2004


CVS commit by arwalker: 

Use more meaningful variable names.
Indent correctly.
Remove obsolete check.


  M +9 -15     kst2dplot.cpp   1.321


--- kdeextragear-2/kst/kst/kst2dplot.cpp  #1.320:1.321
@@ -5088,4 +5088,5 @@ void Kst2DPlot::plotCurves(QPainter& p,
       if (c->hasLines()) {
         QPointArray points(MAX_NUM_POLYLINES);
+        double lineWidth;
         bool foundNan;
         int lastPlottedX = 0;
@@ -5093,11 +5094,7 @@ void Kst2DPlot::plotCurves(QPainter& p,
         int index = 0;
         int i0Start = i0;
-        double lw;
-
-        lw = (c->lineWidth() < penWidth ? penWidth : c->lineWidth());
 
-        p.setPen(QPen(c->color(),
-                      int(lw),
-                      style));
+        lineWidth = (double)(c->lineWidth() < penWidth ? penWidth : c->lineWidth());
+        p.setPen(QPen(c->color(), int(lineWidth), style));
 
 // Optimize - isnan seems expensive, at least in gcc debug mode
@@ -5186,13 +5183,10 @@ void Kst2DPlot::plotCurves(QPainter& p,
                     if (maxY <= Hy && minY >= Ly) {
                       if (style == Qt::SolidLine) {
-                        minY-=lw/1.99999;
-                        maxY+=lw/1.99999;
+                        minY -= lineWidth/1.99999;
+                        maxY += lineWidth/1.99999;
                         p.drawLine(d2i(X2), d2i(minY), d2i(X2), d2i(maxY));
                       } else {
-                        //if (lastPlottedX != d2i(X2) || index >= MAX_NUM_POLYLINES-2) {
                         if (index >= MAX_NUM_POLYLINES-2) {
-                          if (index > 1) {
                             p.drawPolyline(points, 0, index);
-                          }
                           index = 0;
                         }





More information about the Kst mailing list