File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -48,13 +48,15 @@ void litehtml::flex_line::distribute_free_space(pixel_t container_main_size)
4848 while (processed)
4949 {
5050 pixel_t sum_scaled_flex_shrink_factor = 0 ;
51+ int sum_flex_grow_factor = 0 ;
5152 pixel_t remaining_free_space = container_main_size;
5253 int total_not_frozen = 0 ;
5354 for (auto &item: items)
5455 {
5556 if (!item->frozen )
5657 {
5758 sum_scaled_flex_shrink_factor += item->scaled_flex_shrink_factor ;
59+ sum_flex_grow_factor += item->grow ;
5860 remaining_free_space -= item->base_size ;
5961 total_not_frozen++;
6062 } else
@@ -115,7 +117,7 @@ void litehtml::flex_line::distribute_free_space(pixel_t container_main_size)
115117 // factors of all unfrozen items on the line. Set the item’s target main size to
116118 // its flex base size plus a fraction of the remaining free space proportional
117119 // to the ratio.
118- item->main_size = item->base_size + remaining_free_space * (pixel_t ) item->grow / (pixel_t ) total_flex_factor ;
120+ item->main_size = item->base_size + remaining_free_space * (pixel_t ) item->grow / (pixel_t ) sum_flex_grow_factor ;
119121
120122 // d. Fix min/max violations. Clamp each non-frozen item’s target main size by its used
121123 // min and max main sizes and floor its content-box size at zero. If the item’s target
You can’t perform that action at this time.
0 commit comments