[Kst] extragear/graphics/kst/kst

Rick Chern rchern at interchange.ubc.ca
Wed Jul 20 00:45:04 CEST 2005


SVN commit 436541 by rchern:

Locking of images and use correct array size

 M  +2 -0      kst2dplot.cpp  
 M  +3 -3      kstmatrix.cpp  


--- trunk/extragear/graphics/kst/kst/kst2dplot.cpp #436540:436541
@@ -6193,6 +6193,7 @@
     double img_Lx_pix = 0, img_Ly_pix = 0, img_Hx_pix = 0, img_Hy_pix = 0;
 
     KstImagePtr image = *(_images.at(i));
+    image->readLock();
     image->matrixDimensions(x, y, width, height);
 
     // figure out where the image will be on the plot
@@ -6411,6 +6412,7 @@
         }
       }
     }
+    image->readUnlock();
   }
 }
 
--- trunk/extragear/graphics/kst/kst/kstmatrix.cpp #436540:436541
@@ -80,7 +80,7 @@
   if (x_index >= _nX || x_index < 0 || y_index >= _nY || y_index < 0) {
     return false;
   }
-  if (index >= _NS || index < 0 ) {
+  if (index >= _zSize || index < 0 ) {
     return false;
   }
   z = _z[index];
@@ -93,7 +93,7 @@
   if (x >= _nX || x < 0 || y >= _nY || y < 0) {
     return false;
   }
-  if (index >= _NS || index < 0 ) {
+  if (index >= _zSize || index < 0 ) {
     return false;
   }
   z = _z[index];
@@ -148,7 +148,7 @@
     
 void KstMatrix::zero() {
   _minZNoSpike = _maxZNoSpike = 0.0;
-  for (int i = 0; i < _NS; i++) {
+  for (int i = 0; i < _zSize; i++) {
     _z[i] = 0.0;  
   }
   setDirty();


More information about the Kst mailing list