1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:47:34 +00:00

LibWeb/Layout: Replace isfinite() with might_be_saturated()

Since we switched to using fixed-point math for CSSPixels, it cannot
represent infinite values, so we need to check if the value is
saturated instead.
This commit is contained in:
Aliaksandr Kalenik 2023-08-17 17:11:04 +02:00 committed by Andreas Kling
parent c40e441894
commit f2a15ecea7
2 changed files with 5 additions and 5 deletions

View file

@ -11,7 +11,7 @@ namespace Web::Layout {
AvailableSize AvailableSize::make_definite(CSSPixels value)
{
VERIFY(isfinite(value.to_double()));
VERIFY(!value.might_be_saturated());
return AvailableSize { Type::Definite, value };
}