1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:48:12 +00:00

LibWeb: Use PaintContext::would_be_fully_clipped_by_painter() everywhere

Always use `would_be_fully_clipped_by_painter` to check if painting can
be skipped.

This allows to quickly find all the places where this check happens and
also removes incosistency that before we checked for intersection with
viewport rect in some places and for intersection with painter clip
rect in other places.
This commit is contained in:
Aliaksandr Kalenik 2023-06-19 22:33:08 +03:00 committed by Andreas Kling
parent cee1f9ba5d
commit b37fbcb159
2 changed files with 2 additions and 5 deletions

View file

@ -45,10 +45,7 @@ void PaintableBox::invalidate_stacking_context()
bool PaintableBox::is_out_of_view(PaintContext& context) const
{
return !context.enclosing_device_rect(absolute_paint_rect())
.to_type<int>()
.translated(context.painter().translation())
.intersects(context.painter().clip_rect());
return context.would_be_fully_clipped_by_painter(context.enclosing_device_rect(absolute_paint_rect()));
}
PaintableWithLines::PaintableWithLines(Layout::BlockContainer const& layout_box)