lv_btnm: drawing bugfix

This commit is contained in:
Gabor Kiss-Vamosi
2018-12-30 15:58:14 +01:00
parent 7ac12cd071
commit a9921c78e8

View File

@@ -193,6 +193,7 @@ void lv_btnm_set_map(lv_obj_t * btnm, const char ** map)
btn_cnt ++; btn_cnt ++;
} }
/*Only deal with the non empty lines*/ /*Only deal with the non empty lines*/
if(btn_cnt != 0) { if(btn_cnt != 0) {
/*Calculate the width of all units*/ /*Calculate the width of all units*/
@@ -232,7 +233,7 @@ void lv_btnm_set_map(lv_obj_t * btnm, const char ** map)
act_y += btn_h + style_bg->body.padding.inner; act_y += btn_h + style_bg->body.padding.inner;
/*Make sure the last row is at the bottom of 'btnm'*/ /*Make sure the last row is at the bottom of 'btnm'*/
if(act_y + btn_h * 2 > max_h) { /*Last row?*/ if(map_p_tmp[btn_cnt][0] == '\0') { /*Last row?*/
btn_h = max_h - act_y + style_bg->body.padding.ver - 1; btn_h = max_h - act_y + style_bg->body.padding.ver - 1;
} }