bug fixes

This commit is contained in:
leo 2021-06-06 22:55:26 +02:00
parent 8596e263e7
commit d1943718f9
Signed by: leo
GPG Key ID: 0DD993BFB2B307DB
2 changed files with 10 additions and 6 deletions

View File

@ -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;
}

View File

@ -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;