mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
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.
This commit is contained in:
parent
4fc5e06837
commit
82ddc813d5
Notes:
sideshowbarker
2024-07-17 01:10:58 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/82ddc813d5 Pull-request: https://github.com/SerenityOS/serenity/pull/19025
1 changed files with 1 additions and 6 deletions
|
@ -389,12 +389,7 @@ int StyleValue::to_font_weight() const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (has_integer()) {
|
if (has_integer()) {
|
||||||
int font_weight_integer = to_integer();
|
return 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;
|
|
||||||
}
|
}
|
||||||
if (is_calculated()) {
|
if (is_calculated()) {
|
||||||
auto maybe_weight = const_cast<CalculatedStyleValue&>(as_calculated()).resolve_integer();
|
auto maybe_weight = const_cast<CalculatedStyleValue&>(as_calculated()).resolve_integer();
|
||||||
|
|
Loading…
Reference in a new issue