mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-07-23 01:02:36 +00:00
for 'pinch end' events on mobile devices, send dummy value -1 for (focus|span)_(x|y)
This commit is contained in:
@@ -266,8 +266,7 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativePinchUpdate)(
|
||||
jfloat scale, jfloat span_x, jfloat span_y, jfloat focus_x, jfloat focus_y);
|
||||
|
||||
JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativePinchEnd)(
|
||||
JNIEnv *env, jclass jcls,
|
||||
jfloat span_x, jfloat span_y, jfloat focus_x, jfloat focus_y);
|
||||
JNIEnv *env, jclass jcls);
|
||||
|
||||
JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeMouse)(
|
||||
JNIEnv *env, jclass jcls,
|
||||
@@ -393,7 +392,7 @@ static JNINativeMethod SDLActivity_tab[] = {
|
||||
{ "onNativeTouch", "(IIIFFF)V", SDL_JAVA_INTERFACE(onNativeTouch) },
|
||||
{ "onNativePinchStart", "(FFFF)V", SDL_JAVA_INTERFACE(onNativePinchStart) },
|
||||
{ "onNativePinchUpdate", "(FFFFF)V", SDL_JAVA_INTERFACE(onNativePinchUpdate) },
|
||||
{ "onNativePinchEnd", "(FFFF)V", SDL_JAVA_INTERFACE(onNativePinchEnd) },
|
||||
{ "onNativePinchEnd", "()V", SDL_JAVA_INTERFACE(onNativePinchEnd) },
|
||||
{ "onNativeMouse", "(IIFFZ)V", SDL_JAVA_INTERFACE(onNativeMouse) },
|
||||
{ "onNativePen", "(IIIIFFF)V", SDL_JAVA_INTERFACE(onNativePen) },
|
||||
{ "onNativeClipboardChanged", "()V", SDL_JAVA_INTERFACE(onNativeClipboardChanged) }
|
||||
@@ -1420,12 +1419,12 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativePinchUpdate)(
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativePinchEnd)(
|
||||
JNIEnv *env, jclass jcls, jfloat span_x, jfloat span_y, jfloat focus_x, jfloat focus_y)
|
||||
JNIEnv *env, jclass jcls)
|
||||
{
|
||||
SDL_LockMutex(Android_ActivityMutex);
|
||||
|
||||
if (Android_Window) {
|
||||
SDL_SendPinch(SDL_EVENT_PINCH_END, 0, Android_Window, 0, span_x, span_y, focus_x, focus_y);
|
||||
SDL_SendPinch(SDL_EVENT_PINCH_END, 0, Android_Window, 0, -1.0f, -1.0f, -1.0f, -1.0f);
|
||||
}
|
||||
|
||||
SDL_UnlockMutex(Android_ActivityMutex);
|
||||
|
||||
@@ -2042,17 +2042,17 @@ static void Cocoa_SendMouseButtonClicks(SDL_Mouse *mouse, NSEvent *theEvent, SDL
|
||||
{
|
||||
switch ([theEvent phase]) {
|
||||
case NSEventPhaseBegan:
|
||||
SDL_SendPinch(SDL_EVENT_PINCH_BEGIN, Cocoa_GetEventTimestamp([theEvent timestamp]), NULL, 0, -1, -1, -1, -1);
|
||||
SDL_SendPinch(SDL_EVENT_PINCH_BEGIN, Cocoa_GetEventTimestamp([theEvent timestamp]), NULL, 0, -1.0f, -1.0f, -1.0f, -1.0f);
|
||||
break;
|
||||
case NSEventPhaseChanged:
|
||||
{
|
||||
CGFloat scale = 1.0f + [theEvent magnification];
|
||||
SDL_SendPinch(SDL_EVENT_PINCH_UPDATE, Cocoa_GetEventTimestamp([theEvent timestamp]), NULL, scale, -1, -1, -1, -1);
|
||||
SDL_SendPinch(SDL_EVENT_PINCH_UPDATE, Cocoa_GetEventTimestamp([theEvent timestamp]), NULL, scale, -1.0f, -1.0f, -1.0f, -1.0f);
|
||||
}
|
||||
break;
|
||||
case NSEventPhaseEnded:
|
||||
case NSEventPhaseCancelled:
|
||||
SDL_SendPinch(SDL_EVENT_PINCH_END, Cocoa_GetEventTimestamp([theEvent timestamp]), NULL, 0, -1, -1, -1, -1);
|
||||
SDL_SendPinch(SDL_EVENT_PINCH_END, Cocoa_GetEventTimestamp([theEvent timestamp]), NULL, 0, -1.0f, -1.0f, -1.0f, -1.0f);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -514,7 +514,7 @@ extern int SDL_AppleTVRemoteOpenedAsJoystick;
|
||||
case UIGestureRecognizerStateFailed:
|
||||
case UIGestureRecognizerStateEnded:
|
||||
case UIGestureRecognizerStateCancelled:
|
||||
SDL_SendPinch(SDL_EVENT_PINCH_END, 0, sdlwindow, 0, span_x, span_y, focus_x, focus_y);
|
||||
SDL_SendPinch(SDL_EVENT_PINCH_END, 0, sdlwindow, 0, -1.0f, -1.0f, -1.0f, -1.0f);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user