Hendiadyoin1
f9fc0505fb
LibWeb: Add propper rounding to PixelUnits::operator*
...
Also moves related constants into the class to make them accessible for
tests.
2023-08-05 20:03:09 +02:00
Andi Gallo
e9ad8d5e4f
LibWeb: Use i64 for intermediate value in CSSPixels multiplication
...
Reduce the chance of overflow due to fixed point denominator being
squared when multiplying the raw values, before adjusting the final
value back.
2023-08-04 13:36:29 +02:00
Aliaksandr Kalenik
c431167736
LibWeb: Implement subtraction using saturated_addition in CSSPixels
...
Fixes overflow bug found by UBSAN.
2023-07-25 15:21:40 +02:00
Aliaksandr Kalenik
0f21b35d1c
Tests/LibWeb: Add tests for CSSPixels class
...
After the CSSPixels implementation evolved from a wrapper of double
to a fixed-point saturated math arithmetic implementation, it makes
sense to have separate tests for it.
2023-07-25 11:52:02 +02:00