Fix SetMousePosition() for SDL (#3580)

This commit is contained in:
ubkp 2023-11-28 16:37:04 -03:00 committed by GitHub
parent 811abcb19f
commit 1906f1eddf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -941,6 +941,8 @@ int SetGamepadMappings(const char *mappings)
// Set mouse position XY
void SetMousePosition(int x, int y)
{
SDL_WarpMouseInWindow(platform.window, x, y);
CORE.Input.Mouse.currentPosition = (Vector2){ (float)x, (float)y };
CORE.Input.Mouse.previousPosition = CORE.Input.Mouse.currentPosition;
}