mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-08 18:46:03 +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
Notes:
sideshowbarker
2024-07-17 09:43:09 +09:00
Author: https://github.com/MacDue
Commit: 2ceb143571
Pull-request: https://github.com/SerenityOS/serenity/pull/14482
1 changed files with 2 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue