1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 18:57:36 +00:00

LibWeb+LibGfx: Allow filling with a paint style and opacity

This commit is contained in:
MacDue 2023-06-11 13:40:42 +01:00 committed by Andreas Kling
parent 8bd68198d6
commit eb4a58528e
8 changed files with 32 additions and 12 deletions

View file

@ -99,12 +99,12 @@ void SVGGeometryPaintable::paint(PaintContext& context, PaintPhase phase) const
.transform = paint_transform
};
// FIXME: Apply fill opacity to paint styles?
auto fill_opacity = geometry_element.fill_opacity().value_or(svg_context.fill_opacity());
if (auto paint_style = geometry_element.fill_paint_style(paint_context); paint_style.has_value()) {
painter.fill_path(
closed_path(),
*paint_style,
fill_opacity,
Gfx::Painter::WindingRule::EvenOdd);
} else if (auto fill_color = geometry_element.fill_color().value_or(svg_context.fill_color()).with_opacity(fill_opacity); fill_color.alpha() > 0) {
painter.fill_path(