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

Andrew Walker arwalker at sumusltd.com
Wed Jan 9 01:12:29 CET 2008


SVN commit 758749 by arwalker:

make code more robust to changes

 M  +4 -2      kst2dplot.cpp  


--- branches/work/kst/1.6/kst/src/libkstapp/kst2dplot.cpp #758748:758749
@@ -5391,8 +5391,10 @@
 }
 
 void Kst2DPlot::nextImageColorScale() {
-  const double per[5] = {0.0, 0.0001, 0.001, 0.005, 0.02};
-  if (++_i_per>=5) {
+  const double per[] = {0.0, 0.0001, 0.001, 0.005, 0.02};
+  const int length = sizeof(per) / sizeof(double);
+
+  if (++_i_per >= length) {
     _i_per = 0;
   }
   KstImageList images = kstObjectSubList<KstBaseCurve,KstImage>(Curves);


More information about the Kst mailing list