From 5a0176fc9b3430f78570f5d62443ad513bca3f60 Mon Sep 17 00:00:00 2001 From: Armin Brauns Date: Tue, 10 Jan 2023 10:30:10 +0100 Subject: [PATCH] fix(grid): correctly account for side padding with disabled borders (#3910) --- src/layouts/grid/lv_grid.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/layouts/grid/lv_grid.c b/src/layouts/grid/lv_grid.c index 56279197a..60c463bd3 100644 --- a/src/layouts/grid/lv_grid.c +++ b/src/layouts/grid/lv_grid.c @@ -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);