lv_btnm: last row y2 align bugfix

This commit is contained in:
Gabor Kiss-Vamosi
2019-01-06 15:20:06 +01:00
parent 167e26a243
commit 666136851c
+4 -4
View File
@@ -193,6 +193,10 @@ void lv_btnm_set_map(lv_obj_t * btnm, const char ** map)
btn_cnt ++; btn_cnt ++;
} }
/*Make sure the last row is at the bottom of 'btnm'*/
if(map_p_tmp[btn_cnt][0] == '\0') { /*Last row?*/
btn_h = max_h - act_y + style_bg->body.padding.ver - 1;
}
/*Only deal with the non empty lines*/ /*Only deal with the non empty lines*/
if(btn_cnt != 0) { if(btn_cnt != 0) {
@@ -232,10 +236,6 @@ 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'*/
if(map_p_tmp[btn_cnt][0] == '\0') { /*Last row?*/
btn_h = max_h - act_y + style_bg->body.padding.ver - 1;
}
if(strlen(map_p_tmp[btn_cnt]) == 0) break; /*Break on end of map*/ if(strlen(map_p_tmp[btn_cnt]) == 0) break; /*Break on end of map*/
map_p_tmp = &map_p_tmp[btn_cnt + 1]; /*Set the map to the next line*/ map_p_tmp = &map_p_tmp[btn_cnt + 1]; /*Set the map to the next line*/