Skip to content

Commit e2b2195

Browse files
Fabian ZähFabian Zäh
Fabian Zäh
authored and
Fabian Zäh
committed
fix(layout): size in cross direction was not updated when layout on parent was changed from grid to flex
1 parent 7780487 commit e2b2195

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/layouts/flex/lv_flex.c

+8
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,10 @@ static void children_repos(lv_obj_t * cont, flex_t * f, int32_t item_first_id, i
395395
item = get_next_item(cont, f->rev, &item_first_id);
396396
continue;
397397
}
398+
399+
int16_t item_w_layout = item->w_layout;
400+
int16_t item_h_layout = item->h_layout;
401+
398402
int32_t grow_size = lv_obj_get_style_flex_grow(item, LV_PART_MAIN);
399403
if(grow_size) {
400404
int32_t s = 0;
@@ -430,6 +434,10 @@ static void children_repos(lv_obj_t * cont, flex_t * f, int32_t item_first_id, i
430434
item->h_layout = 0;
431435
}
432436

437+
if(item->w_layout != item_w_layout || item->h_layout != item_h_layout) {
438+
lv_obj_mark_layout_as_dirty(item);
439+
}
440+
433441
int32_t cross_pos = 0;
434442
switch(f->cross_place) {
435443
case LV_FLEX_ALIGN_CENTER:

0 commit comments

Comments
 (0)