diff options
author | MacDue <macdue@dueutil.tech> | 2022-07-04 20:47:23 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-07-04 23:09:06 +0200 |
commit | 2ceb14357109a9062d0de155191003b91bd8c723 (patch) | |
tree | 600477b2fd1edf7daadca2b7df5afc0254b0cde2 /Userland/Libraries/LibWeb/Painting | |
parent | 9a97adf121bd032bad11a7c659ca6763669b91a0 (diff) | |
download | serenity-2ceb14357109a9062d0de155191003b91bd8c723.zip |
LibWeb: Use padding box for clipping overflow
The padding box should be used otherwise the content can overflow
on to the boxes borders.
Diffstat (limited to 'Userland/Libraries/LibWeb/Painting')
-rw-r--r-- | Userland/Libraries/LibWeb/Painting/PaintableBox.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp b/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp index b4e0bfc4ba..36a0c8f1dc 100644 --- a/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp +++ b/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp @@ -245,9 +245,10 @@ BorderRadiiData PaintableBox::normalized_border_radii_data() const void PaintableBox::before_children_paint(PaintContext& context, PaintPhase) const { // FIXME: Support more overflow variations. + auto clip_rect = absolute_padding_box_rect().to_rounded<int>(); if (computed_values().overflow_x() == CSS::Overflow::Hidden && computed_values().overflow_y() == CSS::Overflow::Hidden) { context.painter().save(); - context.painter().add_clip_rect(enclosing_int_rect(absolute_border_box_rect())); + context.painter().add_clip_rect(clip_rect); } } |