plotview: Don't recreate the plots all the time

This commit is contained in:
Mike Walters
2016-03-03 23:05:09 +00:00
parent ffdd314f78
commit 9b78f334aa
4 changed files with 27 additions and 24 deletions

View File

@@ -102,6 +102,9 @@ void SpectrogramPlot::mousePressEvent(QMouseEvent *event)
void SpectrogramPlot::paintMid(QPainter &painter, QRect &rect, range_t<off_t> sampleRange)
{
if (!inputSource || inputSource->count() == 0)
return;
for (int x = rect.left(); x < rect.right(); x += linesPerTile()) {
QPixmap *tile = getPixmapTile(sampleRange.minimum + x * getStride());
painter.drawPixmap(QRect(x, rect.y(), linesPerTile(), fftSize), *tile);