src/events/SDL_mouse.c
changeset 12698 0cc2592ed0f4
parent 12695 0c4d04572622
child 12753 ba1a66b57385
     1.1 --- a/src/events/SDL_mouse.c	Sat Apr 06 21:43:16 2019 +0200
     1.2 +++ b/src/events/SDL_mouse.c	Sat Apr 06 21:52:51 2019 +0200
     1.3 @@ -486,14 +486,14 @@
     1.4      /* SDL_HINT_MOUSE_TOUCH_EVENTS: controlling whether mouse events should generate synthetic touch events */
     1.5      if (mouse->mouse_touch_events) {
     1.6          if (mouseID != SDL_TOUCH_MOUSEID && button == SDL_BUTTON_LEFT) {
     1.7 +            if (state == SDL_PRESSED) {
     1.8 +                track_mouse_down = SDL_TRUE;
     1.9 +            } else {
    1.10 +                track_mouse_down = SDL_FALSE;
    1.11 +            }
    1.12              if (window) {
    1.13                  float fx = (float)mouse->x / (float)window->w;
    1.14                  float fy = (float)mouse->y / (float)window->h;
    1.15 -                if (state == SDL_PRESSED) {
    1.16 -                    track_mouse_down = SDL_TRUE;
    1.17 -                } else {
    1.18 -                    track_mouse_down = SDL_FALSE;
    1.19 -                }
    1.20                  SDL_SendTouch(SDL_MOUSE_TOUCHID, 0, track_mouse_down, fx, fy, 1.0f);
    1.21              }
    1.22          }