diff layer/Colour3DPlotLayer.cpp @ 351:b548a36f7633

* Fix duplication of zero'th column in the minus-one'th column position
author Chris Cannam
date Thu, 24 Jan 2008 14:34:27 +0000
parents 0093f351641c
children de4db9b5dcf1
line wrap: on
line diff
--- a/layer/Colour3DPlotLayer.cpp	Thu Jan 24 11:03:59 2008 +0000
+++ b/layer/Colour3DPlotLayer.cpp	Thu Jan 24 14:34:27 2008 +0000
@@ -29,7 +29,7 @@
 
 #include <cassert>
 
-//#define DEBUG_COLOUR_3D_PLOT_LAYER_PAINT 1
+#define DEBUG_COLOUR_3D_PLOT_LAYER_PAINT 1
 
 
 Colour3DPlotLayer::Colour3DPlotLayer() :
@@ -582,10 +582,14 @@
     fillCache(sx0 < 0 ? 0 : sx0,
               sx1 < 0 ? 0 : sx1);
 
+#ifdef DEBUG_COLOUR_3D_PLOT_LAYER_PAINT
+    std::cerr << "Colour3DPlotLayer::paint: height = "<< m_model->getHeight() << ", modelStart = " << modelStart << ", resolution = " << modelResolution << ", model rate = " << m_model->getSampleRate() << std::endl;
+#endif
+
     if (int(m_model->getHeight()) >= v->height() ||
         int(modelResolution * m_model->getSampleRate()) < v->getZoomLevel() / 2) {
 #ifdef DEBUG_COLOUR_3D_PLOT_LAYER_PAINT
-        std::cerr << "Colour3DPlotLayer::paint: height = "<< m_model->getHeight() << ", resolution = " << modelResolution << ", model rate = " << m_model->getSampleRate() << ", calling paintDense" << std::endl;
+        std::cerr << "calling paintDense" << std::endl;
 #endif
         paintDense(v, paint, rect);
         return;
@@ -607,7 +611,7 @@
         
 	int fx = sx * int(modelResolution);
 
-	if (fx + int(modelResolution) < int(modelStart) ||
+	if (fx + int(modelResolution) <= int(modelStart) ||
 	    fx > int(modelEnd)) continue;
 
         int rx0 = v->getXForFrame(int((fx + int(modelStart)) * srRatio));