1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

wheelScrolled event now accepts distance instead of bool

This commit is contained in:
Ivan Savenko
2023-05-27 17:27:49 +03:00
parent e2a85e25fa
commit dc8e9cd048
8 changed files with 37 additions and 25 deletions

View File

@@ -52,11 +52,7 @@ void InputSourceMouse::handleEventMouseButtonDown(const SDL_MouseButtonEvent & b
void InputSourceMouse::handleEventMouseWheel(const SDL_MouseWheelEvent & wheel)
{
// SDL doesn't have the proper values for mouse positions on SDL_MOUSEWHEEL, refetch them
int x = 0, y = 0;
SDL_GetMouseState(&x, &y);
GH.events().dispatchMouseScrolled(Point(wheel.x, wheel.y), Point(x, y));
GH.events().dispatchMouseScrolled(Point(wheel.x, wheel.y), GH.getCursorPosition());
}
void InputSourceMouse::handleEventMouseButtonUp(const SDL_MouseButtonEvent & button)