[tools] Fix progress bar going backwards

Maths was wonky, causing the blocks to go back one on a whole integer.

Change-Id: I1f7d49c1d1b12050dd48b2090dbeff9d4a1c6c38
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133600
Auto-Submit: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
This commit is contained in:
Ben Clayton 2023-05-18 15:54:28 +00:00 committed by Dawn LUCI CQ
parent 97744832bc
commit 3abef3bbe3
1 changed files with 1 additions and 1 deletions

View File

@ -187,7 +187,7 @@ func (s Status) Draw(out io.Writer, width int, ansiColors bool, animFrame int) {
fmt.Fprint(buf, strings.Repeat(string("▉"), numBlocks-1))
}
if numBlocks > 0 {
frac := fNumBlocks - math.Floor(fNumBlocks)
frac := fNumBlocks - float64(numBlocks-1)
symbol := blockSymbols[int(math.Round(frac*float64(len(blockSymbols)-1)))]
fmt.Fprint(buf, string(symbol))
}