Don't try to draw an empty traceplot

fixes #102
This commit is contained in:
Mike Walters
2017-12-24 15:32:31 +00:00
parent 0e86f24557
commit ca2a52dd53

View File

@@ -29,6 +29,8 @@ TracePlot::TracePlot(std::shared_ptr<AbstractSampleSource> source) : Plot(source
void TracePlot::paintMid(QPainter &painter, QRect &rect, range_t<size_t> sampleRange)
{
if (sampleRange.length() == 0) return;
int samplesPerColumn = sampleRange.length() / rect.width();
int samplesPerTile = tileWidth * samplesPerColumn;
size_t tileID = sampleRange.minimum / samplesPerTile;