Catch midnight rollover and reschedule replot timer

This commit is contained in:
Jan Käberich 2023-02-16 00:01:13 +01:00
parent 483c16bcbb
commit 045cf6cc65

View File

@ -571,7 +571,8 @@ void TracePlot::traceDeleted(Trace *t)
void TracePlot::triggerReplot() void TracePlot::triggerReplot()
{ {
auto now = QTime::currentTime(); auto now = QTime::currentTime();
if (lastUpdate.msecsTo(now) >= MinUpdateInterval) { if (lastUpdate.msecsTo(now) >= MinUpdateInterval // last update was a sufficiently long time ago
|| lastUpdate.msecsTo(now) < 0) { // or the time rolled over at midnight
lastUpdate = now; lastUpdate = now;
replot(); replot();
} else { } else {