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

LibWeb: Make division of CSSPixels by integers create a fraction

This also adds some additional operators to `CSSPixelsFraction` to
allow this change to build, since some places were using equations like
`(a / b) + (c / d)` or `-(x / y)`.
This commit is contained in:
Zaggy1024 2023-09-01 14:33:54 -05:00 committed by Alexander Kalenik
parent 607a398917
commit fc05cda8cf
2 changed files with 16 additions and 2 deletions

View file

@ -849,7 +849,7 @@ void GridFormattingContext::distribute_extra_space_across_spanned_tracks_base_si
// Find the item-incurred increase for each spanned track with an affected size by: distributing the space
// equally among such tracks, freezing a tracks item-incurred increase as its affected size + item-incurred
// increase reaches its limit
CSSPixels increase_per_track = max(extra_space / affected_tracks.size(), CSSPixels::smallest_positive_value());
CSSPixels increase_per_track = max(CSSPixels::smallest_positive_value(), extra_space / affected_tracks.size());
for (auto& track : affected_tracks) {
if (track.base_size_frozen)
continue;