mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 04:25:13 +00:00
LibWeb/Layout: Use GlyphRun font to measure trimmed whitespace
This commit is contained in:
parent
e457252c97
commit
3782975718
Notes:
github-actions[bot]
2024-12-06 01:58:33 +00:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/LadybirdBrowser/ladybird/commit/37829757185 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2796
1 changed files with 2 additions and 2 deletions
|
@ -92,8 +92,8 @@ void LineBox::trim_trailing_whitespace()
|
|||
if (!is_ascii_space(last_character))
|
||||
break;
|
||||
|
||||
// FIXME: Use fragment's glyph run to determine the width of the last character.
|
||||
int last_character_width = last_fragment->layout_node().first_available_font().glyph_width(last_character);
|
||||
auto const& font = last_fragment->glyph_run() ? last_fragment->glyph_run()->font() : last_fragment->layout_node().first_available_font();
|
||||
int last_character_width = font.glyph_width(last_character);
|
||||
last_fragment->m_length -= 1;
|
||||
last_fragment->set_inline_length(last_fragment->inline_length() - last_character_width);
|
||||
m_inline_length -= last_character_width;
|
||||
|
|
Loading…
Add table
Reference in a new issue