Bug 4576: fix wrong scaling

This commit is contained in:
Sylvain Becker 2019-04-03 10:14:42 +02:00
parent 236b86067f
commit e39c0a1f7d
1 changed files with 2 additions and 2 deletions

View File

@ -254,7 +254,7 @@ SDL_SendTouch(SDL_TouchID id, SDL_FingerID fingerid,
if (down) { if (down) {
if (finger_touching == SDL_FALSE) { if (finger_touching == SDL_FALSE) {
int pos_x = (int)(x * (float)window->w); int pos_x = (int)(x * (float)window->w);
int pos_y = (int)(y * (float)window->y); int pos_y = (int)(y * (float)window->h);
finger_touching = SDL_TRUE; finger_touching = SDL_TRUE;
first_finger = fingerid; first_finger = fingerid;
SDL_SendMouseMotion(window, SDL_TOUCH_MOUSEID, 0, pos_x, pos_y); SDL_SendMouseMotion(window, SDL_TOUCH_MOUSEID, 0, pos_x, pos_y);
@ -340,7 +340,7 @@ SDL_SendTouchMotion(SDL_TouchID id, SDL_FingerID fingerid,
if (window) { if (window) {
if (finger_touching == SDL_TRUE && first_finger == fingerid) { if (finger_touching == SDL_TRUE && first_finger == fingerid) {
int pos_x = (int)(x * (float)window->w); int pos_x = (int)(x * (float)window->w);
int pos_y = (int)(y * (float)window->y); int pos_y = (int)(y * (float)window->h);
SDL_SendMouseMotion(window, SDL_TOUCH_MOUSEID, 0, pos_x, pos_y); SDL_SendMouseMotion(window, SDL_TOUCH_MOUSEID, 0, pos_x, pos_y);
} }
} }