From c1e811a4fe18db5f02e30e61a93115408b906e65 Mon Sep 17 00:00:00 2001 From: DanielMowitz Date: Sat, 11 Sep 2021 18:59:13 +0200 Subject: [PATCH] Fixed error with tasks that were completed instantly not rendering. --- src/commands/CmdBurndown.cpp | 44 ++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 25 deletions(-) diff --git a/src/commands/CmdBurndown.cpp b/src/commands/CmdBurndown.cpp index 37a23c10e..be9a252be 100644 --- a/src/commands/CmdBurndown.cpp +++ b/src/commands/CmdBurndown.cpp @@ -303,24 +303,16 @@ void Chart::scan (std::vector & tasks) if (_bars.find (epoch) != _bars.end ()) ++_bars[epoch]._removed; + while (from < end) + { + epoch = from.toEpoch (); + if (_bars.find (epoch) != _bars.end ()) + ++_bars[epoch]._pending; + from = increment (from, _period); + } + if (cumulative) { - // Maintain a running total of 'done' tasks that are off the left of the - // chart. - if (end < _earliest) - { - ++_carryover_done; - continue; - } - - while (from < end) - { - epoch = from.toEpoch (); - if (_bars.find (epoch) != _bars.end ()) - ++_bars[epoch]._pending; - from = increment (from, _period); - } - while (from < now) { epoch = from.toEpoch (); @@ -328,19 +320,21 @@ void Chart::scan (std::vector & tasks) ++_bars[epoch]._done; from = increment (from, _period); } + + // Maintain a running total of 'done' tasks that are off the left of the + // chart. + if (end < _earliest) + { + ++_carryover_done; + continue; + } } else { - while (from < end) - { - if (_bars.find (epoch) != _bars.end ()) - ++_bars[epoch]._pending; - from = increment (from, _period); - epoch = from.toEpoch (); - if (_bars.find (epoch) != _bars.end ()) - ++_bars[epoch]._done; - } + epoch = from.toEpoch (); + if (_bars.find (epoch) != _bars.end ()) + ++_bars[epoch]._done; } } }