LibWeb: Use llroundf() when rounding floats
This commit is contained in:
parent
188d9f1326
commit
a211c06e99
Notes:
sideshowbarker
2024-07-17 21:11:12 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/a211c06e99 Pull-request: https://github.com/SerenityOS/serenity/pull/15187
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
Reference in a new issue