mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibWeb: Store computed CSS font size as CSSPixels
The value is originally set using a `CSSPixels` value converted to double, then when it is used it is always converted back to a `CSSPixels` again. Let's just store it as that instead.
This commit is contained in:
committed by
Alexander Kalenik
parent
d792461714
commit
607a398917
Notes:
sideshowbarker
2024-07-18 05:01:22 +09:00
Author: https://github.com/Zaggy1024 Commit: https://github.com/SerenityOS/serenity/commit/607a398917 Pull-request: https://github.com/SerenityOS/serenity/pull/20898 Reviewed-by: https://github.com/AtkinsSJ Reviewed-by: https://github.com/Hendiadyoin1 Reviewed-by: https://github.com/MacDue Reviewed-by: https://github.com/kalenikaliaksandr ✅
@@ -321,7 +321,7 @@ void NodeWithStyle::apply_style(const CSS::StyleProperties& computed_style)
|
||||
// m_font is used by Length::to_px() when resolving sizes against this layout node.
|
||||
// That's why it has to be set before everything else.
|
||||
m_font = computed_style.computed_font();
|
||||
computed_values.set_font_size(computed_style.property(CSS::PropertyID::FontSize)->as_length().length().to_px(*this).to_double());
|
||||
computed_values.set_font_size(computed_style.property(CSS::PropertyID::FontSize)->as_length().length().to_px(*this));
|
||||
computed_values.set_font_weight(round_to<int>(computed_style.property(CSS::PropertyID::FontWeight)->as_number().number()));
|
||||
m_line_height = computed_style.line_height(*this);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user