From 5d293026271678bedd7fd654dd1111077d2996e9 Mon Sep 17 00:00:00 2001 From: Kiss-Vamosi Gabor Date: Sat, 17 Jun 2017 20:43:51 +0200 Subject: [PATCH] lv_cont pretty layout: bugfix if there is 1 too long object in a row --- lv_objx/lv_cont.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lv_objx/lv_cont.c b/lv_objx/lv_cont.c index 94fb6993e..4069f989c 100644 --- a/lv_objx/lv_cont.c +++ b/lv_objx/lv_cont.c @@ -454,9 +454,10 @@ static void lv_cont_layout_pretty(lv_obj_t * cont) if(obj_num == 0) { if(child_rc != NULL) { 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) { lv_obj_align(child_rs, cont, LV_ALIGN_IN_TOP_MID, 0, act_y); }