Mercurial > hg > svgui
diff layer/SpectrumLayer.cpp @ 1256:5a10e9d924d4
Make some corrections to crosshair (measure cursor) positioning and feature descriptions. Needs review.
author | Chris Cannam |
---|---|
date | Tue, 07 Mar 2017 18:54:15 +0000 |
parents | 9e1559b08f0d |
children | 14dcdc596baf |
line wrap: on
line diff
--- a/layer/SpectrumLayer.cpp Tue Mar 07 18:39:37 2017 +0000 +++ b/layer/SpectrumLayer.cpp Tue Mar 07 18:54:15 2017 +0000 @@ -302,6 +302,7 @@ { if (!m_sliceableModel) return 0; double bin = getBinForX(v, x); + cerr << "bin = " << bin << endl; return (m_sliceableModel->getSampleRate() * bin) / (m_sliceableModel->getHeight() * 2); } @@ -462,7 +463,6 @@ while (harmonic < 100) { int hx = int(lrint(getXForFrequency(v, fundamental * harmonic))); - hx += xorigin; if (hx < xorigin || hx > v->getPaintWidth()) break; @@ -513,7 +513,7 @@ QString hzstr; int minfreq = int(lrint((minbin * m_sliceableModel->getSampleRate()) / m_windowSize)); - int maxfreq = int(lrint((std::max(maxbin, minbin+1) + int maxfreq = int(lrint((std::max(maxbin, minbin) * m_sliceableModel->getSampleRate()) / m_windowSize));