mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-16 06:30:41 +00:00
LibWeb: Use padding box for clipping overflow
The padding box should be used otherwise the content can overflow on to the boxes borders.
This commit is contained in:
parent
9a97adf121
commit
2ceb143571
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue