From d747e9daffbde3e45df56bb2804e2d93fa6eaa54 Mon Sep 17 00:00:00 2001 From: Mike Date: Sat, 17 Sep 2016 16:48:29 +0100 Subject: [PATCH] Check for reasonable duration in paintTimeScale Fixes #80 --- plotview.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plotview.cpp b/plotview.cpp index 6ae5e85..a653d0b 100644 --- a/plotview.cpp +++ b/plotview.cpp @@ -388,6 +388,9 @@ void PlotView::paintTimeScale(QPainter &painter, QRect &rect, range_t sam float stopTime = (float)sampleRange.maximum / sampleRate; float duration = stopTime - startTime; + if (duration <= 0) + return; + painter.save(); QPen pen(Qt::white, 1, Qt::SolidLine);