mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-12 01:15:39 +00:00
Use a valid finger ID when generating touch events from mouse events
Fixes https://github.com/libsdl-org/SDL/issues/9185
This commit is contained in:
parent
c6ec999869
commit
107e06a92a
1 changed files with 2 additions and 2 deletions
|
|
@ -571,7 +571,7 @@ static int SDL_PrivateSendMouseMotion(Uint64 timestamp, SDL_Window *window, SDL_
|
|||
if (window) {
|
||||
float normalized_x = x / (float)window->w;
|
||||
float normalized_y = y / (float)window->h;
|
||||
SDL_SendTouchMotion(timestamp, SDL_MOUSE_TOUCHID, 0, window, normalized_x, normalized_y, 1.0f);
|
||||
SDL_SendTouchMotion(timestamp, SDL_MOUSE_TOUCHID, SDL_BUTTON_LEFT, window, normalized_x, normalized_y, 1.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -754,7 +754,7 @@ static int SDL_PrivateSendMouseButton(Uint64 timestamp, SDL_Window *window, SDL_
|
|||
if (window) {
|
||||
float normalized_x = mouse->x / (float)window->w;
|
||||
float normalized_y = mouse->y / (float)window->h;
|
||||
SDL_SendTouch(timestamp, SDL_MOUSE_TOUCHID, 0, window, track_mouse_down, normalized_x, normalized_y, 1.0f);
|
||||
SDL_SendTouch(timestamp, SDL_MOUSE_TOUCHID, SDL_BUTTON_LEFT, window, track_mouse_down, normalized_x, normalized_y, 1.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue