1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:57:45 +00:00

LibWeb/Layout: Rename BlockContainer::paint{_box => able_with_lines}()

It returns a PaintableBox (a PaintableWithLines, to be specific), not a
'PaintBox'. paintable_box() without the cast is already available
through BlockContainer's Box base class, we don't need to shadow it.
This commit is contained in:
Linus Groh 2023-04-20 16:01:38 +01:00 committed by Andreas Kling
parent d58b671ff6
commit a75915f055
8 changed files with 22 additions and 22 deletions

View file

@ -26,14 +26,14 @@ JS::GCPtr<Selection::Selection> Viewport::selection() const
void Viewport::build_stacking_context_tree_if_needed()
{
if (paint_box()->stacking_context())
if (paintable_box()->stacking_context())
return;
build_stacking_context_tree();
}
void Viewport::build_stacking_context_tree()
{
const_cast<Painting::PaintableWithLines*>(paint_box())->set_stacking_context(make<Painting::StackingContext>(*this, nullptr));
const_cast<Painting::PaintableBox*>(paintable_box())->set_stacking_context(make<Painting::StackingContext>(*this, nullptr));
for_each_in_subtree_of_type<Box>([&](Box& box) {
if (!box.paintable_box())
@ -49,15 +49,15 @@ void Viewport::build_stacking_context_tree()
return IterationDecision::Continue;
});
const_cast<Painting::PaintableWithLines*>(paint_box())->stacking_context()->sort();
const_cast<Painting::PaintableBox*>(paintable_box())->stacking_context()->sort();
}
void Viewport::paint_all_phases(PaintContext& context)
{
build_stacking_context_tree_if_needed();
context.painter().fill_rect(context.enclosing_device_rect(paint_box()->absolute_rect()).to_type<int>(), document().background_color(context.palette()));
context.painter().fill_rect(context.enclosing_device_rect(paintable_box()->absolute_rect()).to_type<int>(), document().background_color(context.palette()));
context.painter().translate(-context.device_viewport_rect().location().to_type<int>());
paint_box()->stacking_context()->paint(context);
paintable_box()->stacking_context()->paint(context);
}
void Viewport::recompute_selection_states()