mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-29 11:00:29 +00:00
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.
This commit is contained in:
parent
ceb118e1fa
commit
8855334fcc
Notes:
sideshowbarker
2024-07-17 03:19:51 +09:00
Author: https://github.com/skmagiik Commit: https://github.com/SerenityOS/serenity/commit/8855334fcc Pull-request: https://github.com/SerenityOS/serenity/pull/16442
1 changed files with 1 additions and 1 deletions
|
@ -39,7 +39,7 @@ void CloneTool::draw_point(Gfx::Bitmap& bitmap, Gfx::Color, Gfx::IntPoint point)
|
||||||
|
|
||||||
auto falloff = get_falloff(distance);
|
auto falloff = get_falloff(distance);
|
||||||
auto pixel_color = bitmap.get_pixel(source_x, source_y);
|
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));
|
bitmap.set_pixel(target_x, target_y, bitmap.get_pixel(target_x, target_y).blend(pixel_color));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue