From b7c3f046f7133656b51187afbe7f0dcec53035f2 Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Wed, 14 Apr 2021 23:18:49 +0300 Subject: [PATCH] LibGfx: initialize winding number to 1 for NonZero winding rules Since we first check the winding number and only then update it, fills for "Rectangle-like" (made up of 2 parallel segments) paths would draw nothing when filled by NonZero winding rules. (Fix by alimpfard) --- 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 d17addb5d0..8e3873934e 100644 --- a/Userland/Libraries/LibGfx/Painter.cpp +++ b/Userland/Libraries/LibGfx/Painter.cpp @@ -1696,7 +1696,7 @@ void Painter::fill_path(Path& path, Color color, WindingRule winding_rule) #endif if (active_list.size() > 1) { - auto winding_number { 0 }; + auto winding_number { winding_rule == WindingRule::Nonzero ? 1 : 0 }; for (size_t i = 1; i < active_list.size(); ++i) { auto& previous = active_list[i - 1]; auto& current = active_list[i];