소스 검색

LibWeb: Stop aggressively quantizing font-weight values

Before this change, we were quantizing to either 400, 700 or 900.
This caused us to treat 100/200/300 weighted fonts as if they were
interchangeable.
Andreas Kling 2 년 전
부모
커밋
82ddc813d5
1개의 변경된 파일1개의 추가작업 그리고 6개의 파일을 삭제
  1. 1 6
      Userland/Libraries/LibWeb/CSS/StyleValue.cpp

+ 1 - 6
Userland/Libraries/LibWeb/CSS/StyleValue.cpp

@@ -389,12 +389,7 @@ int StyleValue::to_font_weight() const
         }
     }
     if (has_integer()) {
-        int font_weight_integer = to_integer();
-        if (font_weight_integer <= Gfx::FontWeight::Regular)
-            return Gfx::FontWeight::Regular;
-        if (font_weight_integer <= Gfx::FontWeight::Bold)
-            return Gfx::FontWeight::Bold;
-        return Gfx::FontWeight::Black;
+        return to_integer();
     }
     if (is_calculated()) {
         auto maybe_weight = const_cast<CalculatedStyleValue&>(as_calculated()).resolve_integer();