1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-10 22:31:40 +02:00
This commit is contained in:
Laserlicht
2025-02-22 15:07:38 +01:00
committed by GitHub
parent 802bed69d5
commit 222fe3c0b1

View File

@@ -64,7 +64,7 @@ void InputSourceTouch::handleEventFingerMotion(const SDL_TouchFingerEvent & tfin
motionAccumulatedY[tfinger.fingerId] += tfinger.dy; motionAccumulatedY[tfinger.fingerId] += tfinger.dy;
float motionThreshold = 1.0 / std::min(screenSize.x, screenSize.y); float motionThreshold = 1.0 / std::min(screenSize.x, screenSize.y);
if(motionAccumulatedX[tfinger.fingerId] < motionThreshold && motionAccumulatedY[tfinger.fingerId] < motionThreshold && motionAccumulatedX[tfinger.fingerId] > -motionThreshold && motionAccumulatedY[tfinger.fingerId] > -motionThreshold) if(std::abs(motionAccumulatedX[tfinger.fingerId]) < motionThreshold && std::abs(motionAccumulatedY[tfinger.fingerId]) < motionThreshold)
return; return;
if (CCS && CCS->curh && settings["video"]["cursor"].String() == "software" && state != TouchState::RELATIVE_MODE) if (CCS && CCS->curh && settings["video"]["cursor"].String() == "software" && state != TouchState::RELATIVE_MODE)
@@ -121,8 +121,10 @@ void InputSourceTouch::handleEventFingerMotion(const SDL_TouchFingerEvent & tfin
} }
} }
motionAccumulatedX[tfinger.fingerId] = 0; if(std::abs(motionAccumulatedX[tfinger.fingerId]) >= motionThreshold)
motionAccumulatedY[tfinger.fingerId] = 0; motionAccumulatedX[tfinger.fingerId] = 0;
if(std::abs(motionAccumulatedY[tfinger.fingerId]) >= motionThreshold)
motionAccumulatedY[tfinger.fingerId] = 0;
} }
void InputSourceTouch::handleEventFingerDown(const SDL_TouchFingerEvent & tfinger) void InputSourceTouch::handleEventFingerDown(const SDL_TouchFingerEvent & tfinger)