Mercurial > hg > svgui
comparison layer/SpectrogramLayer.cpp @ 558:9fc13f61ae74
* Avoid warnings for out of range pixel set at edges
author | Chris Cannam |
---|---|
date | Tue, 22 Jun 2010 09:45:42 +0000 |
parents | eabefd562995 |
children | 4c484636d5ec |
comparison
equal
deleted
inserted
replaced
557:3b128519773c | 558:9fc13f61ae74 |
---|---|
2580 } | 2580 } |
2581 | 2581 |
2582 float y = v->getYForFrequency | 2582 float y = v->getYForFrequency |
2583 (freq, displayMinFreq, displayMaxFreq, logarithmic); | 2583 (freq, displayMinFreq, displayMaxFreq, logarithmic); |
2584 | 2584 |
2585 if (y < 0 || y >= h) continue; | 2585 int iy = int(y + 0.5); |
2586 | 2586 if (iy < 0 || iy >= h) continue; |
2587 m_drawBuffer.setPixel(x, y, getDisplayValue(v, value)); | 2587 |
2588 m_drawBuffer.setPixel(x, iy, getDisplayValue(v, value)); | |
2588 } | 2589 } |
2589 | 2590 |
2590 if (mag.isSet()) { | 2591 if (mag.isSet()) { |
2591 if (sx >= int(m_columnMags.size())) { | 2592 if (sx >= int(m_columnMags.size())) { |
2592 #ifdef DEBUG_SPECTROGRAM | 2593 #ifdef DEBUG_SPECTROGRAM |