diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2022-02-08 15:33:27 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-02-08 17:45:51 +0100 |
commit | 103613a3a933a0213c88064f65b1d3e5ab48ec3b (patch) | |
tree | e25fbe7b0faf1f749e8353e8d7028653f8b8b112 /Userland/Libraries/LibWeb/Layout/InlineNode.cpp | |
parent | 10c6c77b5c252ac88a5411b8188b8ee4ed190827 (diff) | |
download | serenity-103613a3a933a0213c88064f65b1d3e5ab48ec3b.zip |
LibWeb: Incorporate spread-distance into box-shadow rendering
We also pass whether the shadow goes inside or outside the element. Only
outer shadows are rendered currently, and inner ones may want to be
handled separately from them, as they will never interfere with each
other.
Diffstat (limited to 'Userland/Libraries/LibWeb/Layout/InlineNode.cpp')
-rw-r--r-- | Userland/Libraries/LibWeb/Layout/InlineNode.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/InlineNode.cpp b/Userland/Libraries/LibWeb/Layout/InlineNode.cpp index c4ba68df0f..1ac4fd6b98 100644 --- a/Userland/Libraries/LibWeb/Layout/InlineNode.cpp +++ b/Userland/Libraries/LibWeb/Layout/InlineNode.cpp @@ -48,10 +48,12 @@ void InlineNode::paint(PaintContext& context, PaintPhase phase) resolved_box_shadow_data.ensure_capacity(computed_box_shadow.size()); for (auto const& layer : computed_box_shadow) { resolved_box_shadow_data.empend( + layer.color, static_cast<int>(layer.offset_x.resolved_or_zero(*this).to_px(*this)), static_cast<int>(layer.offset_y.resolved_or_zero(*this).to_px(*this)), static_cast<int>(layer.blur_radius.resolved_or_zero(*this).to_px(*this)), - layer.color); + static_cast<int>(layer.spread_distance.resolved_or_zero(*this).to_px(*this)), + layer.placement == CSS::BoxShadowPlacement::Outer ? Painting::BoxShadowPlacement::Outer : Painting::BoxShadowPlacement::Inner); } Painting::paint_box_shadow(context, enclosing_int_rect(absolute_fragment_rect), resolved_box_shadow_data); } |