mirror of https://github.com/encounter/SDL.git
Backed out changeset 2e42ec46061e.
This change isn't correct. See comments in Bugzilla #4183.
This commit is contained in:
parent
1089944bee
commit
8f0cc4a4b7
|
@ -83,8 +83,16 @@ xinput2_normalize_touch_coordinates(SDL_VideoData *videodata, Window window,
|
||||||
for (i = 0; i < videodata->numwindows; i++) {
|
for (i = 0; i < videodata->numwindows; i++) {
|
||||||
SDL_WindowData *d = videodata->windowlist[i];
|
SDL_WindowData *d = videodata->windowlist[i];
|
||||||
if (d->xwindow == window) {
|
if (d->xwindow == window) {
|
||||||
*out_x = in_x / d->window->w;
|
if (d->window->w == 1) {
|
||||||
*out_y = in_y / d->window->h;
|
*out_x = 0.5f;
|
||||||
|
} else {
|
||||||
|
*out_x = in_x / (d->window->w - 1);
|
||||||
|
}
|
||||||
|
if (d->window->h == 1) {
|
||||||
|
*out_y = 0.5f;
|
||||||
|
} else {
|
||||||
|
*out_y = in_y / (d->window->h - 1);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue