Parcourir la source

fix pinch event calculation

Laserlicht il y a 8 mois
Parent
commit
75dd4a1acb
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      client/eventsSDL/InputSourceTouch.cpp

+ 2 - 2
client/eventsSDL/InputSourceTouch.cpp

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