From 0e65de2e11e642cbad0cc6b4d441bbe5dd241108 Mon Sep 17 00:00:00 2001 From: MacDue Date: Mon, 28 Nov 2022 22:26:46 +0000 Subject: [PATCH] LibGfx: Don't write blended pixel if the alpha is zero --- Userland/Libraries/LibGfx/Painter.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibGfx/Painter.cpp b/Userland/Libraries/LibGfx/Painter.cpp index a4d734a9fd..c60480f8a9 100644 --- a/Userland/Libraries/LibGfx/Painter.cpp +++ b/Userland/Libraries/LibGfx/Painter.cpp @@ -1833,11 +1833,10 @@ void Painter::set_pixel(IntPoint const& p, Color color, bool blend) if (!clip_rect().contains(point / scale())) return; auto& dst = m_target->scanline(point.y())[point.x()]; - if (!blend) { + if (!blend) dst = color.value(); - } else { + else if (color.alpha()) dst = Color::from_argb(dst).blend(color).value(); - } } Optional Painter::get_pixel(IntPoint const& p)