diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2021-04-14 23:18:49 +0300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-04-14 23:01:23 +0200 |
commit | b7c3f046f7133656b51187afbe7f0dcec53035f2 (patch) | |
tree | e291b1e83a3c5bfd0beb1ceda11caa9be4d4ac47 /Userland/Libraries/LibGfx/Painter.cpp | |
parent | d96354f58e35786d2400934b7e9dca938e319e7e (diff) | |
download | serenity-b7c3f046f7133656b51187afbe7f0dcec53035f2.zip |
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)
Diffstat (limited to 'Userland/Libraries/LibGfx/Painter.cpp')
-rw-r--r-- | Userland/Libraries/LibGfx/Painter.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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]; |