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