mirror of
https://github.com/RGBCube/serenity
synced 2025-05-22 22:05:07 +00:00
LibWeb: Use llroundf() when rounding floats
This commit is contained in:
parent
188d9f1326
commit
a211c06e99
1 changed files with 3 additions and 3 deletions
|
@ -3322,9 +3322,9 @@ Optional<Color> Parser::parse_rgb_or_hsl_color(StringView function_name, Vector<
|
|||
&& params[1].is(Token::Type::Number)
|
||||
&& params[2].is(Token::Type::Number)) {
|
||||
|
||||
u8 r_val = clamp(llround(params[0].number_value()), 0, 255);
|
||||
u8 g_val = clamp(llround(params[1].number_value()), 0, 255);
|
||||
u8 b_val = clamp(llround(params[2].number_value()), 0, 255);
|
||||
u8 r_val = clamp(llroundf(params[0].number_value()), 0, 255);
|
||||
u8 g_val = clamp(llroundf(params[1].number_value()), 0, 255);
|
||||
u8 b_val = clamp(llroundf(params[2].number_value()), 0, 255);
|
||||
|
||||
return Color(r_val, g_val, b_val, a_val);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue