Compare commits
No commits in common. "main" and "v1.0.0" have entirely different histories.
14
ptrstream.go
14
ptrstream.go
@ -452,7 +452,7 @@ func main() {
|
|||||||
app.QueueUpdateDraw(func() {
|
app.QueueUpdateDraw(func() {
|
||||||
var width int
|
var width int
|
||||||
_, _, width, _ = progress.GetInnerRect()
|
_, _, width, _ = progress.GetInnerRect()
|
||||||
if width <= 0 {
|
if width == 0 {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -465,17 +465,7 @@ func main() {
|
|||||||
formatNumber(failed),
|
formatNumber(failed),
|
||||||
float64(failed)/float64(processed)*100)
|
float64(failed)/float64(processed)*100)
|
||||||
|
|
||||||
textWidth := visibleLength(statsText)
|
barWidth := width - visibleLength(statsText) - 2
|
||||||
barWidth := width - textWidth - 2 // -2 for the [] characters
|
|
||||||
|
|
||||||
// Ensure barWidth is at least 1
|
|
||||||
if barWidth < 1 {
|
|
||||||
// If there's not enough space, just show the stats without the progress bar
|
|
||||||
progress.Clear()
|
|
||||||
fmt.Fprint(progress, statsText)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
filled := int(float64(barWidth) * (percent / 100))
|
filled := int(float64(barWidth) * (percent / 100))
|
||||||
if filled > barWidth {
|
if filled > barWidth {
|
||||||
filled = barWidth
|
filled = barWidth
|
||||||
|
Loading…
Reference in New Issue
Block a user