LibDraw: Fix 1px wide glitch in progress bar painting at some widths

Make sure we always line up the "hole" in the progress bar with the
right side of the paint rect. This fixes a 1px wide glitch seen when
using a darker system theme.
This commit is contained in:
Andreas Kling 2019-12-25 21:58:50 +01:00
commit d3b40547f7
Notes: sideshowbarker 2024-07-19 10:40:31 +09:00

View file

@ -249,6 +249,7 @@ void StylePainter::paint_progress_bar(Painter& painter, const Rect& rect, const
float progress_width = progress * rect.width();
Rect hole_rect { (int)progress_width, 0, (int)(rect.width() - progress_width), rect.height() };
hole_rect.move_by(rect.location());
hole_rect.set_right_without_resize(rect.right());
PainterStateSaver saver(painter);
painter.fill_rect(hole_rect, palette.base());