mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 21:47:43 +00:00
LibHTML: Respect the line-height property if set
It's now possible to override the line-height via CSS. It will still default to 1.4 if not specified.
This commit is contained in:
parent
a14cc573b0
commit
b7a840fd0d
1 changed files with 3 additions and 0 deletions
|
@ -103,6 +103,9 @@ void StyleProperties::load_font() const
|
||||||
|
|
||||||
float StyleProperties::line_height() const
|
float StyleProperties::line_height() const
|
||||||
{
|
{
|
||||||
|
auto line_height_length = length_or_fallback(CSS::PropertyID::LineHeight, {});
|
||||||
|
if (line_height_length.is_absolute())
|
||||||
|
return (float)font().glyph_height() * line_height_length.to_px();
|
||||||
return (float)font().glyph_height() * 1.4f;
|
return (float)font().glyph_height() * 1.4f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue