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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int deltaX = (int) firstDown.getX() - (int) secondDown.getX();
|
int deltaXDown = (int) firstDown.getX() - (int) secondDown.getX();
|
||||||
int deltaY = (int) firstDown.getY() - (int) secondDown.getY();
|
int deltaYDown = (int) firstDown.getY() - (int) secondDown.getY();
|
||||||
int squared = deltaX * deltaX + deltaY * deltaY;
|
int squaredDown = deltaXDown * deltaXDown + deltaYDown * deltaYDown;
|
||||||
boolean toReturn = squared < mDoubleTapSlopSquare;
|
|
||||||
return toReturn;
|
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,
|
private static final boolean isConfirmedScale(MotionEvent secondDown,
|
||||||
|
|
Loading…
Reference in a new issue