1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00
This commit is contained in:
Laserlicht 2023-09-18 16:43:16 +02:00 committed by GitHub
parent 7321bb1d25
commit 71659f1423
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -181,15 +181,15 @@ void InputSourceTouch::handleEventFingerUp(const SDL_TouchFingerEvent & tfinger)
case TouchState::TAP_DOWN_SHORT:
{
GH.input().setCursorPosition(convertTouchToMouse(tfinger));
if(tfinger.timestamp - lastLeftClickTimeTicks < doubleTouchTimeMilliseconds && (convertTouchToMouse(tfinger) - lastLeftClickPosition).distance < doubleTouchToleranceDistance)
GH.events().dispatchMouseDoubleClick(convertTouchToMouse(tfinger);
if(tfinger.timestamp - lastLeftClickTimeTicks < params.doubleTouchTimeMilliseconds && (convertTouchToMouse(tfinger) - lastLeftClickPosition).length() < params.doubleTouchToleranceDistance)
GH.events().dispatchMouseDoubleClick(convertTouchToMouse(tfinger));
else
{
GH.events().dispatchMouseLeftButtonPressed(convertTouchToMouse(tfinger), params.touchToleranceDistance);
GH.events().dispatchMouseLeftButtonReleased(convertTouchToMouse(tfinger), params.touchToleranceDistance);
lastLeftClickTimeTicks = tfinger.timestamp;
lastLeftClickPosition = convertTouchToMouse(tfinger);
}
lastLeftClickTimeTicks = tfinger.timestamp;
lastLeftClickPosition = convertTouchToMouse(tfinger);
state = TouchState::IDLE;
break;
}