1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:57:35 +00:00

LibWeb: Fix off-by-one shadow position on non-integer positioned boxes

This fixes a issue due to the background/border painting using
.to_rounded<int>() to get an IntRect, but shadow painting was using
enclosing_int_rect().

enclosing_int_rect() uses some floors/ceils and does not always match
.to_rounded<int>().
This commit is contained in:
MacDue 2022-06-28 11:26:41 +01:00 committed by Andreas Kling
parent cb010fd1f8
commit 97e2e40e4c

View file

@ -230,7 +230,7 @@ void PaintableBox::paint_box_shadow(PaintContext& context) const
static_cast<int>(layer.spread_distance.to_px(layout_box())),
layer.placement == CSS::ShadowPlacement::Outer ? ShadowPlacement::Outer : ShadowPlacement::Inner);
}
Painting::paint_box_shadow(context, enclosing_int_rect(absolute_border_box_rect()), normalized_border_radii_data(), resolved_box_shadow_data);
Painting::paint_box_shadow(context, absolute_border_box_rect().to_rounded<int>(), normalized_border_radii_data(), resolved_box_shadow_data);
}
BorderRadiiData PaintableBox::normalized_border_radii_data() const