Fix camera initial position (#4657)

This commit is contained in:
Asdqwe 2025-01-05 08:30:43 -03:00 committed by GitHub
parent 2f95e8382b
commit ad035edfac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1017,6 +1017,9 @@ void EnableCursor(void)
// Disables cursor (lock cursor) // Disables cursor (lock cursor)
void DisableCursor(void) void DisableCursor(void)
{ {
// Reset mouse position within the window area before disabling cursor
SetMousePosition(CORE.Window.screen.width, CORE.Window.screen.height);
glfwSetInputMode(platform.handle, GLFW_CURSOR, GLFW_CURSOR_DISABLED); glfwSetInputMode(platform.handle, GLFW_CURSOR, GLFW_CURSOR_DISABLED);
// Set cursor position in the middle // Set cursor position in the middle