remove the threshold

This commit is contained in:
tibbi 2016-02-15 18:19:34 +01:00
parent 89ccb7749f
commit e921b2bbb1
1 changed files with 3 additions and 8 deletions

View File

@ -10,7 +10,6 @@ import android.view.MotionEvent;
import android.view.View;
public class MyCanvas extends View {
private static final float THRESHOLD = 5;
private Paint paint;
private Path path;
private float startX;
@ -39,14 +38,10 @@ public class MyCanvas extends View {
}
private void actionMove(float x, float y) {
final float dx = Math.abs(x - startX);
final float dy = Math.abs(y - startY);
if (dx >= THRESHOLD || dy >= THRESHOLD) {
path.quadTo(startX, startY, (x + startX) / 2, (y + startY) / 2);
startX = x;
startY = y;
}
}
private void actionUp() {
path.lineTo(startX, startY);