mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-07 08:29:58 +00:00
LibGfx: Don't write blended pixel if the alpha is zero
This commit is contained in:
parent
e575339564
commit
0e65de2e11
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue