1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 19:08:10 +00:00

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
parent 69277f5538
commit d3b40547f7

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());