LibWeb: Paint text decoration in front of the text

Previously, the decoration was painted behind the text. This probably
wasn't noticed before, as we didn't compute `text-decoration-color`
values yet and the decoration had the same color anyway.
This commit is contained in:
Karol Kosek 2022-03-06 00:21:07 +01:00 committed by Andreas Kling
parent f9d66bef5d
commit 727e69fe11
Notes: sideshowbarker 2024-07-17 17:52:26 +09:00

View file

@ -97,8 +97,6 @@ void TextNode::paint_fragment(PaintContext& context, const LineBoxFragment& frag
if (document().inspected_node() == &dom_node())
context.painter().draw_rect(enclosing_int_rect(fragment_absolute_rect), Color::Magenta);
paint_text_decoration(painter, fragment);
// FIXME: text-transform should be done already in layout, since uppercase glyphs may be wider than lowercase, etc.
auto text = m_text_for_rendering;
auto text_transform = computed_values().text_transform();
@ -120,6 +118,8 @@ void TextNode::paint_fragment(PaintContext& context, const LineBoxFragment& frag
painter.draw_text(enclosing_int_rect(fragment_absolute_rect), text.substring_view(fragment.start(), fragment.length()), Gfx::TextAlignment::CenterLeft, context.palette().selection_text());
}
paint_text_decoration(painter, fragment);
paint_cursor_if_needed(context, fragment);
}
}