Skip to content

Commit ad035ed

Browse files
authored
Fix camera initial position (#4657)
1 parent 2f95e83 commit ad035ed

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/platforms/rcore_desktop_glfw.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,6 +1017,9 @@ void EnableCursor(void)
10171017
// Disables cursor (lock cursor)
10181018
void DisableCursor(void)
10191019
{
1020+
// Reset mouse position within the window area before disabling cursor
1021+
SetMousePosition(CORE.Window.screen.width, CORE.Window.screen.height);
1022+
10201023
glfwSetInputMode(platform.handle, GLFW_CURSOR, GLFW_CURSOR_DISABLED);
10211024

10221025
// Set cursor position in the middle

0 commit comments

Comments
 (0)