1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 13:47:35 +00:00

LibWeb: Add support for inset shadows

Also move code for outer shadows to a helper.
This commit is contained in:
Andi Gallo 2023-06-05 02:42:32 +00:00 committed by Andreas Kling
parent df79a2720b
commit af1798dd04
4 changed files with 380 additions and 299 deletions

View file

@ -69,7 +69,17 @@ void InlinePaintable::paint(PaintContext& context, PaintPhase phase) const
layer.spread_distance.to_px(layout_node()),
layer.placement == CSS::ShadowPlacement::Outer ? ShadowPlacement::Outer : ShadowPlacement::Inner);
}
paint_box_shadow(context, absolute_fragment_rect, border_radii_data, resolved_box_shadow_data);
auto borders_data = BordersData {
.top = computed_values().border_top(),
.right = computed_values().border_right(),
.bottom = computed_values().border_bottom(),
.left = computed_values().border_left(),
};
auto absolute_fragment_rect_bordered = absolute_fragment_rect.inflated(
borders_data.top.width, borders_data.right.width,
borders_data.bottom.width, borders_data.left.width);
paint_box_shadow(context, absolute_fragment_rect_bordered, absolute_fragment_rect,
borders_data, border_radii_data, resolved_box_shadow_data);
}
return IterationDecision::Continue;