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

feat(indev) add warning log if the pointer's point is out of the screen

This commit is contained in:
Gabor Kiss-Vamosi 2021-05-20 13:10:29 +02:00
parent 4293f9d921
commit 408cddee48

View File

@ -339,6 +339,13 @@ static void indev_pointer_proc(lv_indev_t * i, lv_indev_data_t * data)
data->point.y = data->point.x;
data->point.x = disp->driver->ver_res - tmp - 1;
}
/*Simple sanity check*/
if(data->point.x < 0) LV_LOG_WARN("X is %d which is smaller than zero", data->point.x);
if(data->point.x >= lv_disp_get_hor_res(i->driver->disp)) LV_LOG_WARN("X is %d which is greater than hor. res", data->point.x);
if(data->point.y < 0) LV_LOG_WARN("Y is %d which is smaller than zero", data->point.y);
if(data->point.y >= lv_disp_get_ver_res(i->driver->disp)) LV_LOG_WARN("Y is %d which is greater than hor. res", data->point.y);
/*Move the cursor if set and moved*/
if(i->cursor != NULL &&
(i->proc.types.pointer.last_point.x != data->point.x || i->proc.types.pointer.last_point.y != data->point.y)) {