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

LibWeb: Reset item_incurred_increase before distributing space in GFC

item_incurred_increase should be reset before every next distirbution
because otherwise it will accumulate increases from previous
distributions which is not supposed to happen.
This commit is contained in:
Aliaksandr Kalenik 2023-05-16 07:41:51 +03:00 committed by Andreas Kling
parent 55e8ffd122
commit a613a0973e
3 changed files with 40 additions and 1 deletions

View file

@ -870,8 +870,10 @@ void GridFormattingContext::resolve_intrinsic_track_sizes(AvailableSpace const&
void GridFormattingContext::distribute_extra_space_across_spanned_tracks(CSSPixels item_size_contribution, Vector<TemporaryTrack&>& spanned_tracks)
{
for (auto& track : spanned_tracks)
for (auto& track : spanned_tracks) {
track.planned_increase = 0;
track.item_incurred_increase = 0;
}
// 1. Find the space to distribute:
CSSPixels spanned_tracks_sizes_sum = 0;