mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-01 16:02:53 +00:00
LibWeb: Use doubles for CSS dimension types
Avoid unintentionally converting between float and double multiple times by just using double everywhere. Also, remove the unused `int` versions of their constructors.
This commit is contained in:
parent
95f80bc65b
commit
1feacd4b52
Notes:
sideshowbarker
2024-07-16 18:03:21 +09:00
Author: https://github.com/AtkinsSJ
Commit: 1feacd4b52
Pull-request: https://github.com/SerenityOS/serenity/pull/20678
16 changed files with 34 additions and 73 deletions
|
@ -200,7 +200,7 @@ RefPtr<StyleValue> Parser::parse_linear_gradient_function(ComponentValue const&
|
|||
if (first_param.is(Token::Type::Dimension)) {
|
||||
// <angle>
|
||||
tokens.next_token();
|
||||
float angle_value = first_param.token().dimension_value();
|
||||
auto angle_value = first_param.token().dimension_value();
|
||||
auto unit_string = first_param.token().dimension_unit();
|
||||
auto angle_type = Angle::unit_from_name(unit_string);
|
||||
|
||||
|
@ -320,7 +320,7 @@ RefPtr<StyleValue> Parser::parse_conic_gradient_function(ComponentValue const& c
|
|||
auto angle_token = tokens.next_token();
|
||||
if (!angle_token.is(Token::Type::Dimension))
|
||||
return nullptr;
|
||||
float angle = angle_token.token().dimension_value();
|
||||
auto angle = angle_token.token().dimension_value();
|
||||
auto angle_unit = angle_token.token().dimension_unit();
|
||||
auto angle_type = Angle::unit_from_name(angle_unit);
|
||||
if (!angle_type.has_value())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue