Added progress bar constraint: cur <= total
This commit is contained in:
parent
0539d600a0
commit
393db176f0
@ -38,6 +38,7 @@ void term::progress(int prefixlen,
|
|||||||
u8"\u258F", u8"\u258E", u8"\u258D", u8"\u258C",
|
u8"\u258F", u8"\u258E", u8"\u258D", u8"\u258C",
|
||||||
u8"\u258B", u8"\u258A", u8"\u2589", u8"\u2588"
|
u8"\u258B", u8"\u258A", u8"\u2589", u8"\u2588"
|
||||||
};
|
};
|
||||||
|
if (cur > total) cur = total;
|
||||||
int perclen = 5;
|
int perclen = 5;
|
||||||
int barwidth = cols() - perclen - prefixlen - 1;
|
int barwidth = cols() - perclen - prefixlen - 1;
|
||||||
int maxsteps = barwidth * 8;
|
int maxsteps = barwidth * 8;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user