SDL: fixed a crash in onTouchEvent on Android 2.3 devices

This commit is contained in:
Sergii Pylypenko
2016-06-01 23:07:14 +03:00
parent 98f3642373
commit b478e207fc

View File

@@ -997,8 +997,11 @@ class DemoGLSurfaceView extends GLSurfaceView_SDL {
@Override
public boolean onTouchEvent(final MotionEvent event)
{
if (getX() != 0)
event.offsetLocation(-getX(), -getY());
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH)
{
if (getX() != 0)
event.offsetLocation(-getX(), -getY());
}
DifferentTouchInput.touchInput.process(event);
if( DemoRenderer.mRatelimitTouchEvents )
{