mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01: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
|
|
@ -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 New Issue
Block a user