1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-28 07:03:00 +08:00

fix(grid): correctly account for side padding with disabled borders (#3910)

This commit is contained in:
Armin Brauns 2023-01-10 10:30:10 +01:00 committed by GitHub
parent 162e451396
commit 5a0176fc9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -362,9 +362,8 @@ static void grid_update(lv_obj_t * cont, void * user_data)
/*Calculate the grids absolute x and y coordinates.
*It will be used as helper during item repositioning to avoid calculating this value for every children*/
lv_coord_t border_widt = lv_obj_get_style_border_width(cont, LV_PART_MAIN);
lv_coord_t pad_left = lv_obj_get_style_pad_left(cont, LV_PART_MAIN) + border_widt;
lv_coord_t pad_top = lv_obj_get_style_pad_top(cont, LV_PART_MAIN) + border_widt;
lv_coord_t pad_left = lv_obj_get_style_space_left(cont, LV_PART_MAIN);
lv_coord_t pad_top = lv_obj_get_style_space_top(cont, LV_PART_MAIN);
hint.grid_abs.x = pad_left + cont->coords.x1 - lv_obj_get_scroll_x(cont);
hint.grid_abs.y = pad_top + cont->coords.y1 - lv_obj_get_scroll_y(cont);