mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-22 09:12:13 -05:00
LibGfx: Fix color opacity regression in Canvas2D
The color alpha was being overwritten by the global alpha instead of being multiplied.
This commit is contained in:
parent
61755b29c9
commit
26970201bd
Notes:
github-actions[bot]
2024-12-19 12:32:16 +00:00
Author: https://github.com/ananas-dev Commit: https://github.com/LadybirdBrowser/ladybird/commit/26970201bd2 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2974 Reviewed-by: https://github.com/kalenikaliaksandr ✅
1 changed files with 4 additions and 2 deletions
|
@ -195,7 +195,8 @@ void PainterSkia::stroke_path(Gfx::Path const& path, Gfx::PaintStyle const& pain
|
|||
auto sk_path = to_skia_path(path);
|
||||
auto paint = to_skia_paint(paint_style, filters);
|
||||
paint.setAntiAlias(true);
|
||||
paint.setAlphaf(global_alpha);
|
||||
float alpha = paint.getAlphaf();
|
||||
paint.setAlphaf(alpha * global_alpha);
|
||||
paint.setStyle(SkPaint::Style::kStroke_Style);
|
||||
paint.setStrokeWidth(thickness);
|
||||
impl().canvas()->drawPath(sk_path, paint);
|
||||
|
@ -228,7 +229,8 @@ void PainterSkia::fill_path(Gfx::Path const& path, Gfx::PaintStyle const& paint_
|
|||
sk_path.setFillType(to_skia_path_fill_type(winding_rule));
|
||||
auto paint = to_skia_paint(paint_style, filters);
|
||||
paint.setAntiAlias(true);
|
||||
paint.setAlphaf(global_alpha);
|
||||
float alpha = paint.getAlphaf();
|
||||
paint.setAlphaf(alpha * global_alpha);
|
||||
impl().canvas()->drawPath(sk_path, paint);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue