mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 15:47:45 +00:00
LibWeb: Fix a rounding issue on CSSPixels multiplication
Co-Authored-By: ronak69 <ronak69@danwin1210.de>
This commit is contained in:
parent
096cecb95e
commit
b342b4dfb8
2 changed files with 9 additions and 2 deletions
|
@ -170,8 +170,8 @@ public:
|
|||
// Rounding:
|
||||
// If last bit cut off was 1:
|
||||
if (value & (1u << (fractional_bits - 1))) {
|
||||
// If the bit after was 1 as well
|
||||
if (value & (radix_mask >> 2u)) {
|
||||
// If any bit after was 1 as well
|
||||
if (value & (radix_mask >> 1u)) {
|
||||
// We need to round away from 0
|
||||
int_value = Checked<int>::saturating_add(int_value, 1);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue