mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-26 03:18:47 +02: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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user