LibGfx: Don't write blended pixel if the alpha is zero

This commit is contained in:
MacDue 2022-11-28 22:26:46 +00:00 committed by Linus Groh
parent e575339564
commit 0e65de2e11
Notes: sideshowbarker 2024-07-17 03:58:31 +09:00

View file

@ -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<Color> Painter::get_pixel(IntPoint const& p)