bug fixes
This commit is contained in:
parent
8596e263e7
commit
d1943718f9
@ -21,7 +21,7 @@ void DisplayArea::paintEvent(QPaintEvent *event)
|
||||
|
||||
bool DisplayArea::pixelSet(int x, int y)
|
||||
{
|
||||
if(x>image.width()||y>image.height()) return false;
|
||||
if(x>=image.width()||y>=image.height()) return false;
|
||||
return qAlpha(image.pixel(x,y))==255;
|
||||
}
|
||||
|
||||
|
@ -48,6 +48,13 @@ void InputParser::process()
|
||||
case 1:
|
||||
computeEpochDate();
|
||||
break;
|
||||
case 3:
|
||||
minFreq=qMin(minFreq,currentLine.minFreq);
|
||||
maxFreq=qMax(maxFreq,currentLine.maxFreq);
|
||||
break;
|
||||
case 4:
|
||||
if(decimal) currentLine.freqStep++;
|
||||
break;
|
||||
default:
|
||||
if(index>5){
|
||||
sendPixel();
|
||||
@ -58,11 +65,10 @@ void InputParser::process()
|
||||
decimal=false;
|
||||
break;
|
||||
case '\n':
|
||||
minFreq=qMin(minFreq,currentLine.minFreq);
|
||||
maxFreq=qMax(maxFreq,currentLine.maxFreq);
|
||||
|
||||
sendPixel();
|
||||
|
||||
if(currentLine.maxFreq==maxFreq) currentY++;
|
||||
|
||||
lastMaxFreq=currentLine.maxFreq;
|
||||
|
||||
index=0;
|
||||
@ -160,8 +166,6 @@ void InputParser::sendPixel()
|
||||
|
||||
currentX=(currentLine.minFreq-minFreq)/currentLine.freqStep+(index-5);
|
||||
|
||||
if(display->pixelSet(currentX,currentY)) currentY++;
|
||||
|
||||
display->setPixel(currentX,currentY,color);
|
||||
currentX++;
|
||||
currentPowerValue=0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user