diff layer/Colour3DPlotLayer.cpp @ 105:571805759a66

* 1502816 file export is too slow and memory-hungry Use text stream when writing to file instead of accumulating into a string. * 1500625 Auto-align in MIDI layer confusing Make value extents convert to Hz in return value * 1494623: Duplicate display of frame 0 from vamp plugin output
author Chris Cannam
date Thu, 15 Jun 2006 15:48:05 +0000
parents 2be85befe873
children 999ae0f7d10c
line wrap: on
line diff
--- a/layer/Colour3DPlotLayer.cpp	Thu Jun 15 12:28:47 2006 +0000
+++ b/layer/Colour3DPlotLayer.cpp	Thu Jun 15 15:48:05 2006 +0000
@@ -363,7 +363,15 @@
 
     for (int x = x0; x < x1; ++x) {
 
-        float sx0 = (float(v->getFrameForX(x)) - modelStart) / modelWindow;
+        long xf = v->getFrameForX(x);
+        if (xf < 0) {
+            for (int y = 0; y < h; ++y) {
+                img.setPixel(x - x0, y, m_cache->color(0));
+            }
+            continue;
+        }
+
+        float sx0 = (float(xf) - modelStart) / modelWindow;
         float sx1 = (float(v->getFrameForX(x+1)) - modelStart) / modelWindow;
             
         int sx0i = int(sx0 + 0.001);