Fix: cursor pos does not reset to the middle

might be a feature too, idk, if anyone asks to bring it back, add a
switch
This commit is contained in:
Duy Tran Khanh committed 2023-04-26 11:01:55 +07:00
1 parent ce7047808f
commit 82d5191fda
1 file changed
+4 -1
+4 -1
View File
@@ -321,7 +321,10 @@ JNIEXPORT void JNICALL Java_org_lwjgl_glfw_CallbackBridge_nativeSetGrabbing(JNIE
UIView *surfaceView = vc.surfaceView;
if (isGrabbing == JNI_TRUE) {
CGFloat screenScale = [[UIScreen mainScreen] scale] * resolutionScale;
CallbackBridge_nativeSendCursorPos(ACTION_DOWN, lastVirtualMousePoint.x * screenScale, lastVirtualMousePoint.y * screenScale);//TODO
CallbackBridge_nativeSendCursorPos(ACTION_DOWN, lastVirtualMousePoint.x * screenScale, lastVirtualMousePoint.y * screenScale);
CGRect screenBounds = [[UIScreen mainScreen] bounds];
virtualMouseFrame.origin.x = screenBounds.size.width / 2;
virtualMouseFrame.origin.y = screenBounds.size.height / 2;
vc.mousePointerView.frame = virtualMouseFrame;
}
vc.scrollPanGesture.enabled = !isGrabbing;