Backed out changeset dfebed374d73.
authorRyan C. Gordon <icculus@icculus.org>
Sun, 22 Jul 2018 19:42:08 -0400
changeset 12069317db3d3712c
parent 12068 ce88faaf8bd2
child 12070 1d65571b57dd
Backed out changeset dfebed374d73.

This change isn't correct. See comments in Bugzilla #4183.
src/video/x11/SDL_x11xinput2.c
     1.1 --- a/src/video/x11/SDL_x11xinput2.c	Sun Jul 22 19:40:42 2018 -0400
     1.2 +++ b/src/video/x11/SDL_x11xinput2.c	Sun Jul 22 19:42:08 2018 -0400
     1.3 @@ -83,8 +83,16 @@
     1.4      for (i = 0; i < videodata->numwindows; i++) {
     1.5          SDL_WindowData *d = videodata->windowlist[i];
     1.6          if (d->xwindow == window) {
     1.7 -            *out_x = in_x / d->window->w;
     1.8 -            *out_y = in_y / d->window->h;
     1.9 +            if (d->window->w == 1) {
    1.10 +                *out_x = 0.5f;
    1.11 +            } else {
    1.12 +                *out_x = in_x / (d->window->w - 1);
    1.13 +            }
    1.14 +            if (d->window->h == 1) {
    1.15 +                *out_y = 0.5f;
    1.16 +            } else {
    1.17 +                *out_y = in_y / (d->window->h - 1);
    1.18 +            }
    1.19              return;
    1.20          }
    1.21      }