Codebase list golang-github-vbauerster-mpb / 78a9823
refill refactoring Vladimir Bauer 4 years ago
1 changed file(s) with 8 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
198198
199199 if stat.Refill > 0 {
200200 refWidth := int(internal.PercentageRound(stat.Total, stat.Refill, uint(width)))
201 available := curWidth
202 bound := available - refWidth
203 for i := len(filling) - 1; available > bound && i > 0; i-- {
201 if refWidth == curWidth {
202 refWidth -= tip.width
203 }
204 for i := len(filling) - 1; i >= 0; i-- {
205 if refWidth < s.components[iRefiller].width {
206 break
207 }
204208 filling[i] = s.components[iRefiller].bytes
205 available -= s.components[iRefiller].width
209 refWidth -= s.components[iRefiller].width
206210 }
207211 }
208212