# HG changeset patch # User Chris Cannam # Date 1541605580 0 # Node ID c2c8e071e24f7ee1e869faa48bb98be1b4938758 # Parent 2b532ff7f22e73e4ff3b777372f932771aa01556 Comment diff -r 2b532ff7f22e -r c2c8e071e24f data/model/FFTModel.cpp --- a/data/model/FFTModel.cpp Wed Nov 07 15:46:10 2018 +0000 +++ b/data/model/FFTModel.cpp Wed Nov 07 15:46:20 2018 +0000 @@ -126,7 +126,9 @@ float FFTModel::getMagnitudeAt(int x, int y) const { - if (x < 0 || x >= getWidth() || y < 0 || y >= getHeight()) return 0.f; + if (x < 0 || x >= getWidth() || y < 0 || y >= getHeight()) { + return 0.f; + } auto col = getFFTColumn(x); return abs(col[y]); } @@ -318,7 +320,7 @@ // spectrograms where values from two consecutive columns are // needed at once. This cache gets essentially no hits when // scrolling through a magnitude spectrogram, but 95%+ hits with a - // peak-frequency spectrogram. + // peak-frequency spectrogram or spectrum. for (const auto &incache : m_cached) { if (incache.n == n) { inSmallCache.hit();