mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-08 22:26:51 +02:00
fix pinch event calculation
This commit is contained in:
@@ -333,8 +333,8 @@ void InputSourceTouch::emitPinchEvent(const SDL_TouchFingerEvent & tfinger)
|
||||
float newX = thisX - otherX;
|
||||
float newY = thisY - otherY;
|
||||
|
||||
double distanceOld = std::sqrt(oldX * oldX + oldY + oldY);
|
||||
double distanceNew = std::sqrt(newX * newX + newY + newY);
|
||||
double distanceOld = std::sqrt(oldX * oldX + oldY * oldY);
|
||||
double distanceNew = std::sqrt(newX * newX + newY * newY);
|
||||
|
||||
if (distanceOld > params.pinchSensitivityThreshold)
|
||||
GH.events().dispatchGesturePinch(lastTapPosition, distanceNew / distanceOld);
|
||||
|
Reference in New Issue
Block a user