diff layer/Colour3DPlotLayer.cpp @ 537:0cc658fe1423

* Fix colour 3d plot's habit of repeating column 0 in column -1's position
author Chris Cannam
date Fri, 05 Jun 2009 10:48:25 +0000
parents aca01b3af29f
children be5c35d3f409
line wrap: on
line diff
--- a/layer/Colour3DPlotLayer.cpp	Fri May 22 15:50:10 2009 +0000
+++ b/layer/Colour3DPlotLayer.cpp	Fri Jun 05 10:48:25 2009 +0000
@@ -1410,9 +1410,9 @@
                 targetLine[x] = 0;
 
                 float sx0 = sxa[x*2];
+                if (sx0 < 0) continue;
                 int sx0i = int(sx0 + epsilon);
                 if (sx0i >= sw) break;
-                if (sx0i < 0) continue;
 
                 float a, b, value;
 
@@ -1488,10 +1488,13 @@
             
                 for (int x = 0; x < w; ++x) {
 
-                    int sx1i = int(sxa[x*2 + 1]);
-                    if (sx1i < 0) continue;
+                    float sx1 = sxa[x*2 + 1];
+                    if (sx1 < 0) continue;
+                    int sx1i = int(sx1);
 
-                    int sx0i = int(sxa[x*2] + epsilon);
+                    float sx0 = sxa[x*2];
+                    if (sx0 < 0) continue;
+                    int sx0i = int(sx0 + epsilon);
                     if (sx0i >= sw) break;
 
                     uchar peak = 0;