From ca2a52dd535f56860e3decff46780bc973f1dd00 Mon Sep 17 00:00:00 2001 From: Mike Walters Date: Sun, 24 Dec 2017 15:32:31 +0000 Subject: [PATCH] Don't try to draw an empty traceplot fixes #102 --- traceplot.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/traceplot.cpp b/traceplot.cpp index 66abb03..3704d24 100644 --- a/traceplot.cpp +++ b/traceplot.cpp @@ -29,6 +29,8 @@ TracePlot::TracePlot(std::shared_ptr source) : Plot(source void TracePlot::paintMid(QPainter &painter, QRect &rect, range_t sampleRange) { + if (sampleRange.length() == 0) return; + int samplesPerColumn = sampleRange.length() / rect.width(); int samplesPerTile = tileWidth * samplesPerColumn; size_t tileID = sampleRange.minimum / samplesPerTile;