mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-19 07:33:20 +00:00
LibWeb: Make text-decoration lines entire width of fragment
This fixes an issue where text decorations (e.g. underlines) of text split across multiple fragments would have unintended 1px gaps. Gains us 2 WPT passes (imported)
This commit is contained in:
parent
858450922b
commit
9aa2d1bd3e
Notes:
github-actions[bot]
2025-09-12 06:08:17 +00:00
Author: https://github.com/Calme1709
Commit: 9aa2d1bd3e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6166
Reviewed-by: https://github.com/tcl3 ✅
8 changed files with 154 additions and 4 deletions
|
@ -841,16 +841,16 @@ void paint_text_decoration(DisplayListRecordingContext& context, TextPaintable c
|
|||
return;
|
||||
case CSS::TextDecorationLine::Underline:
|
||||
line_start_point = context.rounded_device_point(fragment_box.top_left().translated(0, baseline + 2));
|
||||
line_end_point = context.rounded_device_point(fragment_box.top_right().translated(-1, baseline + 2));
|
||||
line_end_point = context.rounded_device_point(fragment_box.top_right().translated(0, baseline + 2));
|
||||
break;
|
||||
case CSS::TextDecorationLine::Overline:
|
||||
line_start_point = context.rounded_device_point(fragment_box.top_left().translated(0, baseline - glyph_height));
|
||||
line_end_point = context.rounded_device_point(fragment_box.top_right().translated(-1, baseline - glyph_height));
|
||||
line_end_point = context.rounded_device_point(fragment_box.top_right().translated(0, baseline - glyph_height));
|
||||
break;
|
||||
case CSS::TextDecorationLine::LineThrough: {
|
||||
auto x_height = font.x_height();
|
||||
line_start_point = context.rounded_device_point(fragment_box.top_left().translated(0, baseline - x_height * CSSPixels(0.5f)));
|
||||
line_end_point = context.rounded_device_point(fragment_box.top_right().translated(-1, baseline - x_height * CSSPixels(0.5f)));
|
||||
line_end_point = context.rounded_device_point(fragment_box.top_right().translated(0, baseline - x_height * CSSPixels(0.5f)));
|
||||
break;
|
||||
}
|
||||
case CSS::TextDecorationLine::Blink:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue