diff --git a/bar_filler_bar.go b/bar_filler_bar.go index c930ac3..4949bbe 100644 --- a/bar_filler_bar.go +++ b/bar_filler_bar.go @@ -170,22 +170,20 @@ var filling [][]byte var padding [][]byte - var tip *component var refWidth int curWidth := int(internal.PercentageRound(stat.Total, stat.Current, width)) filled := curWidth - if stat.Current == stat.Total { - if s.tip.onCompleteIndex >= uint(len(s.tip.frames)) { - s.tip.onCompleteIndex = 0 - } - tip = s.tip.frames[s.tip.onCompleteIndex] - } else { - tip = s.tip.frames[s.tip.count%uint(len(s.tip.frames))] - } + tip := s.tip.frames[s.tip.count%uint(len(s.tip.frames))] if s.tip.inclusive { if curWidth > 0 { + if stat.Current == stat.Total { + if s.tip.onCompleteIndex >= uint(len(s.tip.frames)) { + s.tip.onCompleteIndex = 0 + } + tip = s.tip.frames[s.tip.onCompleteIndex] + } filling = append(filling, tip.bytes) curWidth -= tip.width s.tip.count++