Rotate touchscreen coordinate to adapt to Qt app

This commit is contained in:
lijie02 2019-01-21 17:37:36 +08:00
parent 964682bb35
commit 8e7ab60cee
1 changed files with 11 additions and 9 deletions

View File

@ -631,15 +631,17 @@ Output:
static void gtp_touch_down(struct goodix_ts_data* ts,s32 id,s32 x,s32 y,s32 w) static void gtp_touch_down(struct goodix_ts_data* ts,s32 id,s32 x,s32 y,s32 w)
{ {
dprintk(DEBUG_X_Y_INFO, "source data:ID:%d, X:%d, Y:%d, W:%d\n", id, x, y, w); dprintk(DEBUG_X_Y_INFO, "source data:ID:%d, X:%d, Y:%d, W:%d\n", id, x, y, w);
if(1 == exchange_x_y_flag){ //if(1 == exchange_x_y_flag){
swap(x, y); // swap(x, y);
} //}
if(1 == revert_x_flag){ //if(1 == revert_x_flag){
x = SCREEN_MAX_X - x; // x = SCREEN_MAX_X - x;
} //}
if(1 == revert_y_flag){ //if(1 == revert_y_flag){
y = SCREEN_MAX_Y - y; // y = SCREEN_MAX_Y - y;
} //}
x = GTP_MAX_WIDTH - x;
dprintk(DEBUG_X_Y_INFO,"report data:ID:%d, X:%d, Y:%d, W:%d\n", id, x, y, w); dprintk(DEBUG_X_Y_INFO,"report data:ID:%d, X:%d, Y:%d, W:%d\n", id, x, y, w);
#if GTP_ICS_SLOT_REPORT #if GTP_ICS_SLOT_REPORT