Skip to content

Commit

Permalink
Fix camera initial position (#4657)
Browse files Browse the repository at this point in the history
  • Loading branch information
asdqwe authored Jan 5, 2025
1 parent 2f95e83 commit ad035ed
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/platforms/rcore_desktop_glfw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,9 @@ void EnableCursor(void)
// Disables cursor (lock cursor)
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);

// Set cursor position in the middle
Expand Down

0 comments on commit ad035ed

Please sign in to comment.