changeset 471:72a080272a4e

* Change QMutex in Editable DTDM to a read/write lock
author Chris Cannam
date Mon, 26 Jan 2009 15:18:32 +0000
parents 26d1ddc0ce96
children 13e8edbffbd7
files layer/Colour3DPlotLayer.cpp
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/layer/Colour3DPlotLayer.cpp	Mon Jan 26 10:49:31 2009 +0000
+++ b/layer/Colour3DPlotLayer.cpp	Mon Jan 26 15:18:32 2009 +0000
@@ -722,6 +722,7 @@
     size_t modelEndBin = modelEnd / modelResolution;
 
     size_t cacheWidth = modelEndBin - modelStartBin + 1;
+    if (lastBin > modelEndBin) cacheWidth = lastBin - modelStartBin + 1;
     size_t cacheHeight = m_model->getHeight();
 
     if (m_cache && (m_cache->height() != int(cacheHeight))) {
@@ -1096,7 +1097,7 @@
     int x1 = rect.right() + 1;
 
     const int w = x1 - x0; // const so it can be used as array size below
-    int h = v->height();
+    int h = v->height(); // we always paint full height
     int sh = m_model->getHeight();
 
     int symin = m_miny;
@@ -1162,7 +1163,9 @@
             goto copy;
         }
 
-        memset(peaks, 0, w);
+        for (int x = 0; x < w; ++x) {
+            peaks[x] = 0;
+        }
         
         for (int sy = sy0i; sy <= sy1i; ++sy) {