Changeset - ebfc27478fc5
[Not reviewed]
default
0 1 0
Hasan Yavuz Ă–ZDERYA - 9 years ago 2016-08-15 00:12:10
hy@ozderya.net
fix auto scale always including 0
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/framebuffer.cpp
Show inline comments
 
@@ -105,26 +105,26 @@ void FrameBuffer::addSamples(double* sam
 
    }
 
    else // number of new samples equal or bigger than current size
 
    {
 
        int x = shift - _size;
 
        for (size_t i = 0; i < _size; i++)
 
        {
 
            data[i] = samples[i+x];
 
        }
 
        headIndex = 0;
 
    }
 

	
 
    // update bounding rectangle
 
    double minValue = 0;
 
    double maxValue = 0;
 
    double minValue = data[0];
 
    double maxValue = data[0];
 
    for (size_t i = 0; i < _size; i++)
 
    {
 
        if (data[i] > maxValue)
 
        {
 
            maxValue = data[i];
 
        }
 
        else if (data[i] < minValue)
 
        {
 
            minValue = data[i];
 
        }
 
    }
 
    _boundingRect.setTop(minValue);
0 comments (0 inline, 0 general)