mirror of
https://github.com/p-ranav/indicators.git
synced 2025-12-16 04:18:51 +08:00
small fixes
This commit is contained in:
@@ -92,6 +92,7 @@ public:
|
|||||||
os << lead_text;
|
os << lead_text;
|
||||||
for (size_t i = 0; i < (bar_width - whole_width - 1); ++i)
|
for (size_t i = 0; i < (bar_width - whole_width - 1); ++i)
|
||||||
os << " ";
|
os << " ";
|
||||||
|
return os;
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
std::ostream& os;
|
std::ostream& os;
|
||||||
@@ -117,12 +118,13 @@ public:
|
|||||||
auto pos = static_cast<size_t>(progress * static_cast<float>(bar_width) / 100.0);
|
auto pos = static_cast<size_t>(progress * static_cast<float>(bar_width) / 100.0);
|
||||||
for (size_t i = 0; i < bar_width; ++i) {
|
for (size_t i = 0; i < bar_width; ++i) {
|
||||||
if (i < pos)
|
if (i < pos)
|
||||||
std::cout << fill;
|
os << fill;
|
||||||
else if (i == pos)
|
else if (i == pos)
|
||||||
std::cout << lead;
|
os << lead;
|
||||||
else
|
else
|
||||||
std::cout << remainder;
|
os << remainder;
|
||||||
}
|
}
|
||||||
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
Reference in New Issue
Block a user