|
@@ -275,7 +275,9 @@ getEnv(JavaVM* vm)
|
|
|
if (e) {
|
|
|
UITouch *touch = [touches anyObject];
|
|
|
CGPoint position = [touch locationInView: nil];
|
|
|
- (*e)->CallVoidMethod(e, self.harness, self.injectTouchBegin, 0, touch.timestamp, position.x, position.y);
|
|
|
+ float scale = _glview.contentScaleFactor;
|
|
|
+ // NOTE: cast to jlong is required, otherwise JmeAppHarness receives non-sense values
|
|
|
+ (*e)->CallVoidMethod(e, self.harness, self.injectTouchBegin, 0, (jlong) touch.timestamp, position.x * scale, position.y * scale);
|
|
|
if ((*e)->ExceptionCheck(e)) {
|
|
|
NSLog(@"Could not invoke iOS Harness injectTouchBegin");
|
|
|
(*e)->ExceptionDescribe(e);
|
|
@@ -290,7 +292,8 @@ getEnv(JavaVM* vm)
|
|
|
if (e) {
|
|
|
UITouch *touch = [touches anyObject];
|
|
|
CGPoint position = [touch locationInView: nil];
|
|
|
- (*e)->CallVoidMethod(e, self.harness, self.injectTouchMove, 0, touch.timestamp, position.x, position.y);
|
|
|
+ float scale = _glview.contentScaleFactor;
|
|
|
+ (*e)->CallVoidMethod(e, self.harness, self.injectTouchMove, 0, (jlong) touch.timestamp, position.x * scale, position.y * scale);
|
|
|
if ((*e)->ExceptionCheck(e)) {
|
|
|
NSLog(@"Could not invoke iOS Harness injectTouchMove");
|
|
|
(*e)->ExceptionDescribe(e);
|
|
@@ -305,7 +308,8 @@ getEnv(JavaVM* vm)
|
|
|
if (e) {
|
|
|
UITouch *touch = [touches anyObject];
|
|
|
CGPoint position = [touch locationInView: nil];
|
|
|
- (*e)->CallVoidMethod(e, self.harness, self.injectTouchEnd, 0, touch.timestamp, position.x, position.y);
|
|
|
+ float scale = _glview.contentScaleFactor;
|
|
|
+ (*e)->CallVoidMethod(e, self.harness, self.injectTouchEnd, 0, (jlong) touch.timestamp, position.x * scale, position.y * scale);
|
|
|
if ((*e)->ExceptionCheck(e)) {
|
|
|
NSLog(@"Could not invoke iOS Harness injectTouchEnd");
|
|
|
(*e)->ExceptionDescribe(e);
|