diff options
author | Cody Hein <skmagiik@gmail.com> | 2022-12-11 18:26:50 -0700 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-12-13 11:35:25 +0100 |
commit | 8855334fccbee8197ff0ce44c9a18d681e80d4fc (patch) | |
tree | 4cdb295b45d2f14995a070d7da36cc9fedbafeb0 /Userland | |
parent | ceb118e1fad7d1b7c267338b4c29620baea84152 (diff) | |
download | serenity-8855334fccbee8197ff0ce44c9a18d681e80d4fc.zip |
PixelPaint: Use source alpha for CloneTool drawing
Prior to this change when using CloneTool on a transparent background
the output was a solid black brush stroke. Now it is based on the
source content alpha as well as it's color blended with the target.
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Applications/PixelPaint/Tools/CloneTool.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Applications/PixelPaint/Tools/CloneTool.cpp b/Userland/Applications/PixelPaint/Tools/CloneTool.cpp index 907c7ebb37..63d5d580e7 100644 --- a/Userland/Applications/PixelPaint/Tools/CloneTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/CloneTool.cpp @@ -39,7 +39,7 @@ void CloneTool::draw_point(Gfx::Bitmap& bitmap, Gfx::Color, Gfx::IntPoint point) auto falloff = get_falloff(distance); auto pixel_color = bitmap.get_pixel(source_x, source_y); - pixel_color.set_alpha(falloff * 255); + pixel_color.set_alpha(falloff * pixel_color.alpha()); bitmap.set_pixel(target_x, target_y, bitmap.get_pixel(target_x, target_y).blend(pixel_color)); } } |