mirror of
https://github.com/glfw/glfw.git
synced 2024-11-11 13:03:52 +00:00
Fixed cursor centering for odd window sizes.
This commit is contained in:
parent
d82095d7ea
commit
7af99bce88
@ -41,6 +41,7 @@ guide in the GLFW documentation.
|
|||||||
focus callback
|
focus callback
|
||||||
- [Win32] Bugfix: The disabled cursor mode clip rectangle was updated for
|
- [Win32] Bugfix: The disabled cursor mode clip rectangle was updated for
|
||||||
unfocused windows
|
unfocused windows
|
||||||
|
- [Win32] Bugfix: Cursor was not properly re-centered over odd-sized windows
|
||||||
- [Cocoa] Added dependency on CoreVideo framework for refresh rate retrieval
|
- [Cocoa] Added dependency on CoreVideo framework for refresh rate retrieval
|
||||||
- [Cocoa] Enabled Lion full screen for resizable windowed mode windows
|
- [Cocoa] Enabled Lion full screen for resizable windowed mode windows
|
||||||
- [Cocoa] Moved to Cocoa API for application transformation and activation
|
- [Cocoa] Moved to Cocoa API for application transformation and activation
|
||||||
|
@ -157,7 +157,7 @@ typedef struct _GLFWwindowWin32
|
|||||||
GLboolean cursorCentered;
|
GLboolean cursorCentered;
|
||||||
GLboolean cursorInside;
|
GLboolean cursorInside;
|
||||||
GLboolean cursorHidden;
|
GLboolean cursorHidden;
|
||||||
double oldCursorX, oldCursorY;
|
int oldCursorX, oldCursorY;
|
||||||
} _GLFWwindowWin32;
|
} _GLFWwindowWin32;
|
||||||
|
|
||||||
|
|
||||||
|
@ -604,7 +604,7 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
|
|||||||
if (newCursorX != window->win32.oldCursorX ||
|
if (newCursorX != window->win32.oldCursorX ||
|
||||||
newCursorY != window->win32.oldCursorY)
|
newCursorY != window->win32.oldCursorY)
|
||||||
{
|
{
|
||||||
double x, y;
|
int x, y;
|
||||||
|
|
||||||
if (window->cursorMode == GLFW_CURSOR_DISABLED)
|
if (window->cursorMode == GLFW_CURSOR_DISABLED)
|
||||||
{
|
{
|
||||||
@ -1121,8 +1121,8 @@ void _glfwPlatformSetCursorPos(_GLFWwindow* window, double xpos, double ypos)
|
|||||||
ClientToScreen(window->win32.handle, &pos);
|
ClientToScreen(window->win32.handle, &pos);
|
||||||
SetCursorPos(pos.x, pos.y);
|
SetCursorPos(pos.x, pos.y);
|
||||||
|
|
||||||
window->win32.oldCursorX = xpos;
|
window->win32.oldCursorX = (int) xpos;
|
||||||
window->win32.oldCursorY = ypos;
|
window->win32.oldCursorY = (int) ypos;
|
||||||
}
|
}
|
||||||
|
|
||||||
void _glfwPlatformSetCursorMode(_GLFWwindow* window, int mode)
|
void _glfwPlatformSetCursorMode(_GLFWwindow* window, int mode)
|
||||||
|
Loading…
Reference in New Issue
Block a user