# HG changeset patch # User Chris Cannam # Date 1277199942 0 # Node ID 9fc13f61ae74c6927d7066ae27e1f93607af786d # Parent 3b128519773cd67b7b06c90ff788d5fcaf622a89 * Avoid warnings for out of range pixel set at edges diff -r 3b128519773c -r 9fc13f61ae74 layer/SpectrogramLayer.cpp --- a/layer/SpectrogramLayer.cpp Tue Jun 15 10:48:28 2010 +0000 +++ b/layer/SpectrogramLayer.cpp Tue Jun 22 09:45:42 2010 +0000 @@ -2582,9 +2582,10 @@ float y = v->getYForFrequency (freq, displayMinFreq, displayMaxFreq, logarithmic); - if (y < 0 || y >= h) continue; - - m_drawBuffer.setPixel(x, y, getDisplayValue(v, value)); + int iy = int(y + 0.5); + if (iy < 0 || iy >= h) continue; + + m_drawBuffer.setPixel(x, iy, getDisplayValue(v, value)); } if (mag.isSet()) {