changeset 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 3b128519773c
children 5bcfc5606528
files layer/SpectrogramLayer.cpp
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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()) {