Little stability improvement of doubletap scale.

This commit is contained in:
GaidamakUA 2016-01-28 17:28:57 +02:00
parent 4709e105be
commit 1359d92a9c

View file

@ -104,11 +104,15 @@ public class DoubleTapScaleDetector {
return false;
}
int deltaX = (int) firstDown.getX() - (int) secondDown.getX();
int deltaY = (int) firstDown.getY() - (int) secondDown.getY();
int squared = deltaX * deltaX + deltaY * deltaY;
boolean toReturn = squared < mDoubleTapSlopSquare;
return toReturn;
int deltaXDown = (int) firstDown.getX() - (int) secondDown.getX();
int deltaYDown = (int) firstDown.getY() - (int) secondDown.getY();
int squaredDown = deltaXDown * deltaXDown + deltaYDown * deltaYDown;
int deltaXUp = (int) firstDown.getX() - (int) secondDown.getX();
int deltaYUp = (int) firstDown.getY() - (int) secondDown.getY();
int squaredUp = deltaXUp * deltaXUp + deltaYUp * deltaYUp;
return squaredDown < mDoubleTapSlopSquare && squaredUp < mDoubleTapSlopSquare;
}
private static final boolean isConfirmedScale(MotionEvent secondDown,