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:
parent
162e451396
commit
5a0176fc9b
@ -362,9 +362,8 @@ static void grid_update(lv_obj_t * cont, void * user_data)
|
|||||||
|
|
||||||
/*Calculate the grids absolute x and y coordinates.
|
/*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*/
|
*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_space_left(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_space_top(cont, LV_PART_MAIN);
|
||||||
lv_coord_t pad_top = lv_obj_get_style_pad_top(cont, LV_PART_MAIN) + border_widt;
|
|
||||||
hint.grid_abs.x = pad_left + cont->coords.x1 - lv_obj_get_scroll_x(cont);
|
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);
|
hint.grid_abs.y = pad_top + cont->coords.y1 - lv_obj_get_scroll_y(cont);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user