mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-27 00:08:39 +00:00
more information for pinch gestures on mobile
This commit is contained in:
parent
bbcc205de9
commit
e669fd6dfd
10 changed files with 35 additions and 23 deletions
|
|
@ -1087,7 +1087,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||
public static native int nativeCheckSDLThreadCounter();
|
||||
public static native void onNativeFileDialog(int requestCode, String[] filelist, int filter);
|
||||
public static native void onNativePinchStart();
|
||||
public static native void onNativePinchUpdate(float scale);
|
||||
public static native void onNativePinchUpdate(float scale, float span_x, float span_y, float focus_x, float focus_y);
|
||||
public static native void onNativePinchEnd();
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -431,7 +431,11 @@ public class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
|
|||
@Override
|
||||
public boolean onScale(ScaleGestureDetector detector) {
|
||||
float scale = detector.getScaleFactor();
|
||||
SDLActivity.onNativePinchUpdate(scale);
|
||||
float span_x = getNormalizedX(detector.getCurrentSpanX());
|
||||
float span_y = getNormalizedY(detector.getCurrentSpanY());
|
||||
float focus_x = getNormalizedX(detector.getFocusX());
|
||||
float focus_y = getNormalizedY(detector.getFocusY());
|
||||
SDLActivity.onNativePinchUpdate(scale, span_x, span_y, focus_x, focus_y);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue