- Corrected rounding errors on burndown chart bar size calculations (thanks to
  Uli Martens).
This commit is contained in:
Paul Beckingham 2012-03-26 18:16:09 -04:00
parent a73c711188
commit 6100748511
2 changed files with 9 additions and 7 deletions

View file

@ -518,18 +518,18 @@ std::string Chart::render ()
// If it fits within the allowed space.
if (bar.offset < actual_bars)
{
int pending = (bar.pending * graph_height) / labels[2];
int started = (bar.started * graph_height) / labels[2];
int done = ((bar.done + carryover_done) * graph_height) / labels[2];
int pending = ( bar.pending * graph_height) / labels[2];
int started = ((bar.pending + bar.started) * graph_height) / labels[2];
int done = ((bar.pending + bar.started + bar.done + carryover_done) * graph_height) / labels[2];
for (int b = 0; b < pending; ++b)
grid.replace (LOC (graph_height - b, max_label + 3 + ((actual_bars - bar.offset - 1) * 3)), 2, "PP");
for (int b = 0; b < started; ++b)
grid.replace (LOC (graph_height - b - pending, max_label + 3 + ((actual_bars - bar.offset - 1) * 3)), 2, "SS");
for (int b = pending; b < started; ++b)
grid.replace (LOC (graph_height - b, max_label + 3 + ((actual_bars - bar.offset - 1) * 3)), 2, "SS");
for (int b = 0; b < done; ++b)
grid.replace (LOC (graph_height - b - pending - started, max_label + 3 + ((actual_bars - bar.offset - 1) * 3)), 2, "DD");
for (int b = started; b < done; ++b)
grid.replace (LOC (graph_height - b, max_label + 3 + ((actual_bars - bar.offset - 1) * 3)), 2, "DD");
}
}