1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-25 22:35:07 +00:00

LibWeb: Store the used font in Layout::NodeWithStyle

This is a step towards not having to carry the full set of specified
values around with every layout node.
This commit is contained in:
Andreas Kling 2021-01-06 11:05:23 +01:00
parent 5721b2a3da
commit e187a5365a
7 changed files with 22 additions and 10 deletions

View file

@ -65,7 +65,7 @@ void LineBox::trim_trailing_whitespace()
return;
auto& last_fragment = m_fragments.last();
int space_width = last_fragment.layout_node().specified_style().font().glyph_width(' ');
int space_width = last_fragment.layout_node().font().glyph_width(' ');
while (last_fragment.length() && isspace(last_text[last_fragment.length() - 1])) {
last_fragment.m_length -= 1;
last_fragment.set_width(last_fragment.width() - space_width);