diff options
author | MacDue <macdue@dueutil.tech> | 2022-06-28 11:26:41 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-06-30 11:16:22 +0200 |
commit | 97e2e40e4cf4192bf1af4d1ab3209f4aca01b6ca (patch) | |
tree | 3b710b45e6cf457a4ccbaccf510012970174b20a | |
parent | cb010fd1f8576a6c04dcffc602d31bf5a057e9df (diff) | |
download | serenity-97e2e40e4cf4192bf1af4d1ab3209f4aca01b6ca.zip |
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>().
-rw-r--r-- | Userland/Libraries/LibWeb/Painting/PaintableBox.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp b/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp index 36391275fe..b4e0bfc4ba 100644 --- a/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp +++ b/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp @@ -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 |