From 1021aba22603fa536478001f7c2a363e356582c8 Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 15 Jul 2021 10:59:49 -0600 Subject: [PATCH] LibGUI: Dither pattern should be independent from clipping rectangle The dither pattern needs to be determined relative to the bitmap itself, not the clipping rectangle. Fixes #8780 --- Userland/Libraries/LibGfx/Painter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibGfx/Painter.cpp b/Userland/Libraries/LibGfx/Painter.cpp index 3e93f9dd50..c2141d4cc9 100644 --- a/Userland/Libraries/LibGfx/Painter.cpp +++ b/Userland/Libraries/LibGfx/Painter.cpp @@ -155,7 +155,7 @@ void Painter::fill_rect_with_dither_pattern(const IntRect& a_rect, Color color_a for (int i = 0; i < rect.height(); ++i) { for (int j = 0; j < rect.width(); ++j) { - bool checkboard_use_a = (i & 1) ^ (j & 1); + bool checkboard_use_a = ((rect.left() + i) & 1) ^ ((rect.top() + j) & 1); if (checkboard_use_a && !color_a.alpha()) continue; if (!checkboard_use_a && !color_b.alpha())