1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 05:27:43 +00:00

LibWeb: Make Painting::Box virtual and add Painting::BoxWithLines

BlockContainer paint boxes are the only ones that have line boxes
associated, so let's not waste memory on line boxes in all the other
types of boxes.

This also adds Layout::Box::paint_box() and the more tightly typed
Layout::BlockContainer::paint_box() to get at the paint box from the
corresponding layout box.
This commit is contained in:
Andreas Kling 2022-03-10 11:12:06 +01:00
parent 9f5cbcaad3
commit 7af03df4c3
11 changed files with 79 additions and 26 deletions

View file

@ -34,6 +34,11 @@ Box::~Box()
{
}
void Box::set_paint_box(OwnPtr<Painting::Box> paint_box)
{
m_paint_box = move(paint_box);
}
void Box::paint(PaintContext& context, Painting::PaintPhase phase)
{
if (!is_visible())