Codebase list golang-github-vbauerster-mpb / 2d67aaa
bar filler: refill path refill path needs to fill filling first Vladimir Bauer 2 years ago
1 changed file(s) with 15 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
207207
208208 var tip component
209209 var refilling, filling, padding []byte
210 var fillCount, refWidth int
210 var fillCount int
211211 curWidth := int(internal.PercentageRound(stat.Total, stat.Current, uint(width)))
212212
213213 if curWidth != 0 && !stat.Completed || s.tipOnComplete {
217217 }
218218
219219 if stat.Refill != 0 {
220 refWidth = int(internal.PercentageRound(stat.Total, stat.Refill, uint(width)))
220 refWidth := int(internal.PercentageRound(stat.Total, stat.Refill, uint(width)))
221221 curWidth -= refWidth
222222 refWidth += curWidth
223 }
224
225 for curWidth-fillCount >= s.components[iFiller].width {
226 filling = append(filling, s.components[iFiller].bytes...)
227 fillCount += s.components[iFiller].width
228 }
229
230 for refWidth-fillCount >= s.components[iRefiller].width {
231 refilling = append(refilling, s.components[iRefiller].bytes...)
232 fillCount += s.components[iRefiller].width
223 for curWidth-fillCount >= s.components[iFiller].width {
224 filling = append(filling, s.components[iFiller].bytes...)
225 fillCount += s.components[iFiller].width
226 }
227 for refWidth-fillCount >= s.components[iRefiller].width {
228 refilling = append(refilling, s.components[iRefiller].bytes...)
229 fillCount += s.components[iRefiller].width
230 }
231 } else {
232 for curWidth-fillCount >= s.components[iFiller].width {
233 filling = append(filling, s.components[iFiller].bytes...)
234 fillCount += s.components[iFiller].width
235 }
233236 }
234237
235238 for width-fillCount >= s.components[iPadding].width {