Skip to content

Commit b772cfe

Browse files
DRKV333tordex
authored andcommitted
Fixed scaled shrink factor using outer base size instead of inner
1 parent b03d570 commit b772cfe

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/flex_item.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ void litehtml::flex_item::init(const litehtml::containing_block_context &self_si
4040
main_size = base_size;
4141
}
4242

43-
scaled_flex_shrink_factor = base_size * shrink;
4443
frozen = false;
4544
}
4645

@@ -212,6 +211,8 @@ void litehtml::flex_item_row_direction::direction_specific_init(const litehtml::
212211
base_size = el->css().get_flex_basis().calc_percent(self_size.render_width) +
213212
el->render_offset_width();
214213
}
214+
215+
scaled_flex_shrink_factor = (base_size - el->render_offset_width()) * shrink;
215216
}
216217

217218
void litehtml::flex_item_row_direction::apply_main_auto_margins()
@@ -391,6 +392,8 @@ void litehtml::flex_item_column_direction::direction_specific_init(const litehtm
391392
base_size = (pixel_t) el->css().get_flex_basis().val() + el->render_offset_height();
392393
}
393394
}
395+
396+
scaled_flex_shrink_factor = (base_size - el->render_offset_height()) * shrink;
394397
}
395398

396399
void litehtml::flex_item_column_direction::apply_main_auto_margins()

0 commit comments

Comments
 (0)