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

fix(table) fix clicking with RTL direction

This commit is contained in:
Gabor Kiss-Vamosi 2021-05-21 12:57:26 +02:00
parent e2710feedb
commit 3fa42f4245

View File

@ -859,8 +859,15 @@ static lv_res_t get_pressed_cell(lv_obj_t * obj, uint16_t * row, uint16_t * col)
lv_coord_t tmp; lv_coord_t tmp;
if(col) { if(col) {
lv_coord_t x = p.x + lv_obj_get_scroll_x(obj); lv_coord_t x = p.x + lv_obj_get_scroll_x(obj);
if(lv_obj_get_style_base_dir(obj, LV_PART_MAIN) == LV_BASE_DIR_RTL) {
x = obj->coords.x2 - lv_obj_get_style_pad_right(obj, LV_PART_MAIN) - x;
}
else {
x -= obj->coords.x1; x -= obj->coords.x1;
x -= lv_obj_get_style_pad_left(obj, LV_PART_MAIN); x -= lv_obj_get_style_pad_left(obj, LV_PART_MAIN);
}
*col = 0; *col = 0;
tmp = 0; tmp = 0;
for(*col = 0; *col < table->col_cnt; (*col)++) { for(*col = 0; *col < table->col_cnt; (*col)++) {