mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-06 06:34:35 +00:00
Ignore the first hover event with a stale position on iOS
Fixes https://github.com/libsdl-org/SDL/issues/15450
(cherry picked from commit 3c02de2f7c)
This commit is contained in:
parent
396cd2d7f7
commit
70d4363890
1 changed files with 5 additions and 0 deletions
|
|
@ -124,6 +124,11 @@ static void UIKit_HandlePenAxes(SDL_Window *window, NSTimeInterval nstimestamp,
|
|||
// rotation is in radians, and only available on a later iOS.
|
||||
const float rotation = rollAngle * radians_to_degrees; // !!! FIXME: this might need adjustment, I don't have a pencil that supports it.
|
||||
|
||||
if (force == 0.0f && (SDL_GetPenStatus(penId, NULL, 0) & SDL_PEN_INPUT_DOWN)) {
|
||||
// The first hover as the pen is being released has a stale position, so ignore it
|
||||
return;
|
||||
}
|
||||
|
||||
SDL_SendPenMotion(timestamp, penId, window, point->x, point->y);
|
||||
SDL_SendPenAxis(timestamp, penId, window, SDL_PEN_AXIS_PRESSURE, pressure);
|
||||
SDL_SendPenAxis(timestamp, penId, window, SDL_PEN_AXIS_XTILT, xtilt);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue