Bug 4576: fix wrong scaling
authorSylvain Becker <sylvain.becker@gmail.com>
Wed, 03 Apr 2019 10:14:42 +0200
changeset 12686a34ab2e5ddcf
parent 12685 b5ff77fd39f2
child 12687 712d84dd14c9
Bug 4576: fix wrong scaling
src/events/SDL_touch.c
     1.1 --- a/src/events/SDL_touch.c	Tue Apr 02 18:07:27 2019 +0200
     1.2 +++ b/src/events/SDL_touch.c	Wed Apr 03 10:14:42 2019 +0200
     1.3 @@ -254,7 +254,7 @@
     1.4              if (down) {
     1.5                  if (finger_touching == SDL_FALSE) {
     1.6                      int pos_x = (int)(x * (float)window->w);
     1.7 -                    int pos_y = (int)(y * (float)window->y);
     1.8 +                    int pos_y = (int)(y * (float)window->h);
     1.9                      finger_touching = SDL_TRUE;
    1.10                      first_finger = fingerid;
    1.11                      SDL_SendMouseMotion(window, SDL_TOUCH_MOUSEID, 0, pos_x, pos_y);
    1.12 @@ -340,7 +340,7 @@
    1.13          if (window) {
    1.14              if (finger_touching == SDL_TRUE && first_finger == fingerid) {
    1.15                  int pos_x = (int)(x * (float)window->w);
    1.16 -                int pos_y = (int)(y * (float)window->y);
    1.17 +                int pos_y = (int)(y * (float)window->h);
    1.18                  SDL_SendMouseMotion(window, SDL_TOUCH_MOUSEID, 0, pos_x, pos_y);
    1.19              }
    1.20          }