1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:28:12 +00:00

LibWeb: Compute text-decoration-color values

Previosly, we used only the text color as a line decoration color.

The FIXME comment has been directly copy-pasted from the border color
note a few lines below.
This commit is contained in:
Karol Kosek 2022-03-06 00:25:42 +01:00 committed by Andreas Kling
parent e74b0b14ed
commit f9d66bef5d
3 changed files with 12 additions and 2 deletions

View file

@ -68,17 +68,19 @@ void TextNode::paint_text_decoration(Gfx::Painter& painter, LineBoxFragment cons
return;
}
auto line_color = computed_values().text_decoration_color();
switch (computed_values().text_decoration_style()) {
// FIXME: Implement the other styles
case CSS::TextDecorationStyle::Solid:
case CSS::TextDecorationStyle::Double:
case CSS::TextDecorationStyle::Dashed:
case CSS::TextDecorationStyle::Dotted:
painter.draw_line(line_start_point, line_end_point, computed_values().color());
painter.draw_line(line_start_point, line_end_point, line_color);
break;
case CSS::TextDecorationStyle::Wavy:
// FIXME: There is a thing called text-decoration-thickness which also affects the amplitude here.
painter.draw_triangle_wave(line_start_point, line_end_point, computed_values().color(), 2);
painter.draw_triangle_wave(line_start_point, line_end_point, line_color, 2);
break;
}
}