Small fix in the loadbar
This commit is contained in:
@@ -94,7 +94,10 @@ bool isIn(const T& value, const std::vector<T>& collection)
|
||||
|
||||
constexpr const char headline[] = "=========================================================";
|
||||
|
||||
static inline void loadbar(unsigned int x, unsigned int n, unsigned int w = 50, unsigned int granularity = 1)
|
||||
static inline void loadbar(unsigned int x,
|
||||
unsigned int n,
|
||||
unsigned int w = 50,
|
||||
unsigned int granularity = 1)
|
||||
{
|
||||
if ((n < 100) || ((x != n) && (x % (n / 100 * granularity) != 0)))
|
||||
return;
|
||||
@@ -106,7 +109,7 @@ static inline void loadbar(unsigned int x, unsigned int n, unsigned int w = 50,
|
||||
for (unsigned int x = 0; x < c; x++)
|
||||
std::cout << "█";
|
||||
|
||||
if(rest > 0 && rest < 0.125)
|
||||
if(rest >= 0 && rest < 0.125 && c != w)
|
||||
std::cout << " ";
|
||||
if(rest >= 0.125 && rest < 2*0.125)
|
||||
std::cout << "▏";
|
||||
|
||||
Reference in New Issue
Block a user