mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-01-18 10:57:07 +00:00
Mouse coordinates are floating point
You can get sub-pixel mouse coordinates and motion depending on the platform and display scaling. Fixes https://github.com/libsdl-org/SDL/issues/2999
This commit is contained in:
@@ -253,7 +253,7 @@ void WINRT_ProcessPointerMovedEvent(SDL_Window *window, Windows::UI::Input::Poin
|
||||
SDL_SendMouseButton(0, window, 0, pressed, button);
|
||||
}
|
||||
|
||||
SDL_SendMouseMotion(0, window, 0, 0, (int)windowPoint.X, (int)windowPoint.Y);
|
||||
SDL_SendMouseMotion(0, window, 0, 0, windowPoint.X, windowPoint.Y);
|
||||
} else {
|
||||
SDL_SendTouchMotion(0,
|
||||
WINRT_TouchID,
|
||||
@@ -390,8 +390,8 @@ void WINRT_ProcessMouseMovedEvent(SDL_Window *window, Windows::Devices::Input::M
|
||||
window,
|
||||
0,
|
||||
1,
|
||||
SDL_lroundf(mouseDeltaInSDLWindowCoords.X),
|
||||
SDL_lroundf(mouseDeltaInSDLWindowCoords.Y));
|
||||
mouseDeltaInSDLWindowCoords.X,
|
||||
mouseDeltaInSDLWindowCoords.Y);
|
||||
}
|
||||
|
||||
#endif // SDL_VIDEO_DRIVER_WINRT
|
||||
|
||||
Reference in New Issue
Block a user