[Input pipe] Try to fix camera pos "teleported" on 1.12.2 and below

This commit is contained in:
khanhduytran0 2020-12-11 05:31:55 +07:00
parent 541782a566
commit 94f1423653

View File

@ -186,8 +186,12 @@ JNIEXPORT void JNICALL Java_org_lwjgl_glfw_CallbackBridge_nativeSetGrabbing(JNIE
isGrabbing = grabbing;
if (isGrabbing == JNI_TRUE) {
// Center the cursor pointer
grabCursorX = savedWidth / 2;
grabCursorY = savedHeight / 2;
if (isUseStackQueueCall) {
grabCursorX = savedWidth / 2;
grabCursorY = savedHeight / 2;
} else {
grabCursorX = grabCursorY = 0;
}
isPrepareGrabPos = true;
}
}