1
0
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:
Laserlicht
2025-02-09 13:11:49 +01:00
parent 1f61f22122
commit 75dd4a1acb

View File

@@ -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);