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

LibWeb: Split Paintable into Paintable and PaintableBox

To prepare for paintable inline content, we take the basic painting
functionality and hoist it into a base class.
This commit is contained in:
Andreas Kling 2022-03-10 15:50:57 +01:00
parent 0500dbc3f6
commit 053766d79c
34 changed files with 133 additions and 95 deletions

View file

@ -14,13 +14,13 @@ NonnullOwnPtr<CanvasPaintable> CanvasPaintable::create(Layout::CanvasBox const&
}
CanvasPaintable::CanvasPaintable(Layout::CanvasBox const& layout_box)
: Paintable(layout_box)
: PaintableBox(layout_box)
{
}
Layout::CanvasBox const& CanvasPaintable::layout_box() const
{
return static_cast<Layout::CanvasBox const&>(m_layout_box);
return static_cast<Layout::CanvasBox const&>(layout_node());
}
void CanvasPaintable::paint(PaintContext& context, PaintPhase phase) const
@ -28,7 +28,7 @@ void CanvasPaintable::paint(PaintContext& context, PaintPhase phase) const
if (!layout_box().is_visible())
return;
Paintable::paint(context, phase);
PaintableBox::paint(context, phase);
if (phase == PaintPhase::Foreground) {
// FIXME: This should be done at a different level. Also rect() does not include padding etc!