1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 09:37:34 +00:00

LibWeb: Convert shadow painting to new pixel units

This commit is contained in:
Sam Atkins 2022-10-27 16:22:19 +01:00 committed by Linus Groh
parent 9d1f30b533
commit fb43a71981
4 changed files with 110 additions and 100 deletions

View file

@ -63,13 +63,13 @@ void InlinePaintable::paint(PaintContext& context, Painting::PaintPhase phase) c
for (auto const& layer : computed_box_shadow) {
resolved_box_shadow_data.empend(
layer.color,
static_cast<int>(layer.offset_x.to_px(layout_node())),
static_cast<int>(layer.offset_y.to_px(layout_node())),
static_cast<int>(layer.blur_radius.to_px(layout_node())),
static_cast<int>(layer.spread_distance.to_px(layout_node())),
layer.offset_x.to_px(layout_node()),
layer.offset_y.to_px(layout_node()),
layer.blur_radius.to_px(layout_node()),
layer.spread_distance.to_px(layout_node()),
layer.placement == CSS::ShadowPlacement::Outer ? Painting::ShadowPlacement::Outer : Painting::ShadowPlacement::Inner);
}
Painting::paint_box_shadow(context, enclosing_int_rect(absolute_fragment_rect), border_radii_data, resolved_box_shadow_data);
Painting::paint_box_shadow(context, absolute_fragment_rect.to_type<CSSPixels>(), border_radii_data, resolved_box_shadow_data);
}
return IterationDecision::Continue;