Little stability improvement of doubletap scale.
This commit is contained in:
parent
4709e105be
commit
1359d92a9c
1 changed files with 9 additions and 5 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue