handle_csi: translate mouse coordinates by margins #609

This commit is contained in:
nick black 2020-05-16 23:59:40 -04:00
parent 84c51d9bde
commit a6629e2ae8
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -162,7 +162,7 @@ handle_csi(notcurses* nc, ncinput* ni){
break;
}
if(ni){
ni->x = param - 1;
ni->x = param - 1 - nc->margin_l;
}
param = 0;
}else if(isdigit(candidate)){
@ -180,7 +180,7 @@ handle_csi(notcurses* nc, ncinput* ni){
break;
}
if(ni){
ni->y = param - 1;
ni->y = param - 1 - nc->margin_t;
ni->id = id;
}
return id;