changeset 1217:51b6381fc413

Make getPreferredPeakCache check the render mode itself
author Chris Cannam
date Fri, 13 Jan 2017 15:37:07 +0000
parents dc2af6616c83
children 4f1f3e1a4f63
files layer/Colour3DPlotRenderer.cpp
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/layer/Colour3DPlotRenderer.cpp	Fri Jan 13 10:29:50 2017 +0000
+++ b/layer/Colour3DPlotRenderer.cpp	Fri Jan 13 15:37:07 2017 +0000
@@ -504,6 +504,8 @@
 
     const DenseThreeDimensionalModel *model = m_sources.source;
     if (!model) return;
+    if (m_params.binDisplay == BinDisplay::PeakFrequencies) return;
+    if (m_params.colourScale.getScale() == ColourScaleType::Phase) return;
     
     int zoomLevel = v->getZoomLevel();
     int binResolution = model->getResolution();
@@ -569,9 +571,7 @@
     int peakCacheIndex = -1;
     int binsPerPeak = -1;
 
-    if (m_params.colourScale.getScale() != ColourScaleType::Phase) {
-        getPreferredPeakCache(v, peakCacheIndex, binsPerPeak);
-    }
+    getPreferredPeakCache(v, peakCacheIndex, binsPerPeak);
     
     for (int y = 0; y < h; ++y) {
         binfory[y] = m_sources.verticalBinLayer->getBinForY(v, h - y - 1);
@@ -1046,7 +1046,7 @@
         (double(minbin + nbins - 1) * fft->getSampleRate()) / fft->getFFTSize();
 
     bool logarithmic = (m_params.binScale == BinScale::Log);
-    
+
     for (int x = start; x != finish; x += step) {
         
         // x is the on-canvas pixel coord; sx (later) will be the