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

fix(tileview) fix position of tiles

This commit is contained in:
Gabor Kiss-Vamosi 2021-05-19 15:28:41 +02:00
parent 30f89f1ce7
commit 7bd449fd59

View File

@ -130,9 +130,11 @@ static void lv_tileview_constructor(const lv_obj_class_t * class_p, lv_obj_t * o
static void lv_tileview_tile_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj)
{
LV_UNUSED(class_p);
lv_obj_t * parent = lv_obj_get_parent(obj);
lv_obj_set_size(obj, LV_PCT(100), LV_PCT(100));
lv_obj_update_layout(obj); /*Be sure the size is correct*/
lv_obj_set_pos(obj, create_col_id * lv_obj_get_content_width(parent), create_row_id * lv_obj_get_content_height(parent));
lv_tileview_tile_t * tile = (lv_tileview_tile_t *)obj;