瀏覽代碼

LibWeb: The line-height should not be multiplied by the glyph height

This was causing very tall lines on many websites. We can now see the
section header thingy on google.com (although it's broken into lines
where it should not be..) :^)
Andreas Kling 5 年之前
父節點
當前提交
4a9deddb4a
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Libraries/LibWeb/CSS/StyleProperties.cpp

+ 1 - 1
Libraries/LibWeb/CSS/StyleProperties.cpp

@@ -176,7 +176,7 @@ 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)line_height_length.to_px();
     return (float)font().glyph_height() * 1.4f;
 }