more information for pinch gestures on mobile

This commit is contained in:
brentfpage 2026-02-22 14:37:52 -08:00
parent bbcc205de9
commit e669fd6dfd
10 changed files with 35 additions and 23 deletions

View file

@ -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();
/**

View file

@ -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;
}