diff --git a/src/events/SDL_gesture.c b/src/events/SDL_gesture.c index a47ab7d13..afdb02827 100644 --- a/src/events/SDL_gesture.c +++ b/src/events/SDL_gesture.c @@ -137,7 +137,7 @@ int SDL_SaveAllDollarTemplates(SDL_RWops *dst) for (i = 0; i < SDL_numGestureTouches; i++) { SDL_GestureTouch* touch = &SDL_gestureTouch[i]; for (j = 0; j < touch->numDollarTemplates; j++) { - rtrn += SaveTemplate(&touch->dollarTemplate[i], dst); + rtrn += SaveTemplate(&touch->dollarTemplate[j], dst); } } return rtrn; @@ -150,7 +150,7 @@ int SDL_SaveDollarTemplate(SDL_GestureID gestureId, SDL_RWops *dst) SDL_GestureTouch* touch = &SDL_gestureTouch[i]; for (j = 0; j < touch->numDollarTemplates; j++) { if (touch->dollarTemplate[i].hash == gestureId) { - return SaveTemplate(&touch->dollarTemplate[i], dst); + return SaveTemplate(&touch->dollarTemplate[j], dst); } } } @@ -454,8 +454,8 @@ static int SDL_SendGestureDollar(SDL_GestureTouch* touch, SDL_Event event; event.dgesture.type = SDL_DOLLARGESTURE; event.dgesture.touchId = touch->id; - event.mgesture.x = touch->centroid.x; - event.mgesture.y = touch->centroid.y; + event.dgesture.x = touch->centroid.x; + event.dgesture.y = touch->centroid.y; event.dgesture.gestureId = gestureId; event.dgesture.error = error; /* A finger came up to trigger this event. */