1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-14 06:42:58 +08:00

lv_cont pretty layout: bugfix if there is 1 too long object in a row

This commit is contained in:
Kiss-Vamosi Gabor 2017-06-17 20:43:51 +02:00
parent 4b33645805
commit 5d29302627

View File

@ -454,9 +454,10 @@ static void lv_cont_layout_pretty(lv_obj_t * cont)
if(obj_num == 0) { if(obj_num == 0) {
if(child_rc != NULL) { if(child_rc != NULL) {
lv_obj_align(child_rc, cont, LV_ALIGN_IN_TOP_MID, 0, act_y); lv_obj_align(child_rc, cont, LV_ALIGN_IN_TOP_MID, 0, act_y);
h_row = lv_obj_get_height(child_rc); /*Not set previously because of the early break*/
} }
} }
/*If here is only one object in the row then align it to the left*/ /*If here is only one object in the row then align it to the middle*/
else if (obj_num == 1) { else if (obj_num == 1) {
lv_obj_align(child_rs, cont, LV_ALIGN_IN_TOP_MID, 0, act_y); lv_obj_align(child_rs, cont, LV_ALIGN_IN_TOP_MID, 0, act_y);
} }