Fix ProgressBar widget overflow (#1288)

This commit is contained in:
Mark Thompson 2023-07-21 00:06:37 -05:00 committed by GitHub
parent 8ce48dbcf6
commit 2af95456a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -573,7 +573,7 @@ void ProgressBar::paint(Painter& painter) {
const auto sr = screen_rect();
const auto s = style();
v_scaled = (sr.size().width() * _value) / _max;
v_scaled = (sr.size().width() * (uint64_t)_value) / _max;
painter.fill_rectangle({sr.location(), {v_scaled, sr.size().height()}}, style().foreground);
painter.fill_rectangle({{sr.location().x() + v_scaled, sr.location().y()}, {sr.size().width() - v_scaled, sr.size().height()}}, s.background);