mirror of
https://github.com/vcmi/vcmi.git
synced 2025-02-13 13:18:43 +02:00
Fixed mouse wheel in xbrz mode, use mouse position information if
provided by SDL
This commit is contained in:
parent
247be94015
commit
9a2d918360
@ -23,6 +23,7 @@
|
||||
|
||||
#include <SDL_events.h>
|
||||
#include <SDL_hints.h>
|
||||
#include <SDL_version.h>
|
||||
|
||||
InputSourceMouse::InputSourceMouse()
|
||||
:mouseToleranceDistance(settings["input"]["mouseToleranceDistance"].Integer())
|
||||
@ -69,7 +70,11 @@ void InputSourceMouse::handleEventMouseButtonDown(const SDL_MouseButtonEvent & b
|
||||
|
||||
void InputSourceMouse::handleEventMouseWheel(const SDL_MouseWheelEvent & wheel)
|
||||
{
|
||||
GH.events().dispatchMouseScrolled(Point(wheel.x, wheel.y) / GH.screenHandler().getScalingFactor(), GH.getCursorPosition());
|
||||
#if SDL_VERSION_ATLEAST(2,26,0)
|
||||
GH.events().dispatchMouseScrolled(Point(wheel.x, wheel.y), Point(wheel.mouseX, wheel.mouseY) / GH.screenHandler().getScalingFactor());
|
||||
#else
|
||||
GH.events().dispatchMouseScrolled(Point(wheel.x, wheel.y), GH.getCursorPosition());
|
||||
#endif
|
||||
}
|
||||
|
||||
void InputSourceMouse::handleEventMouseButtonUp(const SDL_MouseButtonEvent & button)
|
||||
|
Loading…
x
Reference in New Issue
Block a user