-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SDL_SetWindowMouseRect — the set area is one pixel too small #5946
Comments
I think this is the relevant block: https://github.com/libsdl-org/SDL/blob/main/src/video/windows/SDL_windowswindow.c#L1291-L1307 |
Thank you @flibitijibibo. Note that the functions from the Win32 API take care of the correctness of |
Fixed, thanks! |
On the Windows platform, the cursor boundary area is one pixel too small — pixel is missing on the right and bottom of the selected area. To avoid this error, currently I have to increase
Rect.W
andRect.H
by one pixel first, and then pass it toSDL_SetWindowMouseRect
.This problem does not occur when
null
is passed as a pointer to a rect. Apparently, theSDL_SetWindowMouseRect
function miscalculates the coordinates of the right and bottom sides of the rectangle by subtracting one pixel unnecessarily.The text was updated successfully, but these errors were encountered: