mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
LibWeb: Move InlineNode background code from paint_fragment
-> paint
`paint_fragment()` seems to never get called. Moving the painting to `paint()` fixes the background.
This commit is contained in:
parent
aaf12929d5
commit
3b6325e787
Notes:
sideshowbarker
2024-07-18 03:38:31 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/3b6325e7874 Pull-request: https://github.com/SerenityOS/serenity/pull/10146
2 changed files with 6 additions and 8 deletions
|
@ -40,18 +40,17 @@ void InlineNode::split_into_lines(InlineFormattingContext& context, LayoutMode l
|
|||
}
|
||||
}
|
||||
|
||||
void InlineNode::paint_fragment(PaintContext& context, const LineBoxFragment& fragment, PaintPhase phase) const
|
||||
void InlineNode::paint(PaintContext& context, PaintPhase phase)
|
||||
{
|
||||
auto& painter = context.painter();
|
||||
|
||||
if (phase == PaintPhase::Background) {
|
||||
painter.fill_rect(enclosing_int_rect(fragment.absolute_rect()), computed_values().background_color());
|
||||
containing_block()->for_each_fragment([&](auto& fragment) {
|
||||
if (is_inclusive_ancestor_of(fragment.layout_node()))
|
||||
painter.fill_rect(enclosing_int_rect(fragment.absolute_rect()), computed_values().background_color());
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void InlineNode::paint(PaintContext& context, PaintPhase phase)
|
||||
{
|
||||
auto& painter = context.painter();
|
||||
|
||||
if (phase == PaintPhase::Foreground && document().inspected_node() == dom_node()) {
|
||||
// FIXME: This paints a double-thick border between adjacent fragments, where ideally there
|
||||
|
|
|
@ -16,7 +16,6 @@ public:
|
|||
virtual ~InlineNode() override;
|
||||
|
||||
virtual void paint(PaintContext&, PaintPhase) override;
|
||||
virtual void paint_fragment(PaintContext&, const LineBoxFragment&, PaintPhase) const override;
|
||||
|
||||
virtual void split_into_lines(InlineFormattingContext&, LayoutMode) override;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue