# HG changeset patch # User Chris Cannam # Date 1484321827 0 # Node ID 51b6381fc4133b14cca6fdebcdf02aea1e4862e3 # Parent dc2af6616c8389ce559d36ef8b27671ced2f3db9 Make getPreferredPeakCache check the render mode itself diff -r dc2af6616c83 -r 51b6381fc413 layer/Colour3DPlotRenderer.cpp --- 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