small fixes

This commit is contained in:
hyperxor
2020-01-21 20:43:10 +03:00
parent 91ac917bbc
commit cfcc9f3b4c

View File

@@ -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: