소스 검색

Merge pull request #84 from Nibe/cursor-fix

Fixed saved cursor position not being restored.
Camilla Berglund 12 년 전
부모
커밋
0e12fb869c
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      src/input.c

+ 5 - 0
src/input.c

@@ -55,7 +55,12 @@ static void setCursorMode(_GLFWwindow* window, int newMode)
     if (window == _glfw.focusedWindow)
     {
         if (oldMode == GLFW_CURSOR_DISABLED)
+        {
+            window->cursorPosX = _glfw.cursorPosX;
+            window->cursorPosY = _glfw.cursorPosY;
+
             _glfwPlatformSetCursorPos(window, _glfw.cursorPosX, _glfw.cursorPosY);
+        }
         else if (newMode == GLFW_CURSOR_DISABLED)
         {
             int width, height;