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

LibHTML: Add StyleProperties::line_height()

We currently hard-code the line height to 140% of the font glyph height
and this patch doesn't fix the hard-coding, but at least moves it out
of LayoutText and into StyleProperties where it can be re-used until
the day we go and do a proper implementation of CSS line-height. :^)
This commit is contained in:
Andreas Kling 2019-10-12 13:42:58 +02:00
parent 3cef6a5cac
commit 92b6a7a18f
3 changed files with 9 additions and 2 deletions

View file

@ -123,8 +123,7 @@ void LayoutText::split_into_lines(LayoutBlock& container)
{
auto& font = style().font();
int space_width = font.glyph_width(' ') + font.glyph_spacing();
// FIXME: Allow overriding the line-height. We currently default to 140% which seems to look nice.
int line_height = (int)(font.glyph_height() * 1.4f);
int line_height = style().line_height();
auto& line_boxes = container.line_boxes();
if (line_boxes.is_empty())