[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:
parent
97744832bc
commit
3abef3bbe3
|
@ -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))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue