mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 17:10:23 +00:00
LibGfx: Don't write blended pixel if the alpha is zero
This commit is contained in:
parent
e575339564
commit
0e65de2e11
Notes:
sideshowbarker
2024-07-17 03:58:31 +09:00
Author: https://github.com/MacDue Commit: https://github.com/SerenityOS/serenity/commit/0e65de2e11 Pull-request: https://github.com/SerenityOS/serenity/pull/16243
1 changed files with 2 additions and 3 deletions
|
@ -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