mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user