We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7ae12b5 commit 44f0355Copy full SHA for 44f0355
lib/java/com/google/android/material/timepicker/ClockHandView.java
@@ -316,9 +316,7 @@ public boolean onTouchEvent(MotionEvent event) {
316
break;
317
case MotionEvent.ACTION_MOVE:
318
case MotionEvent.ACTION_UP:
319
- final int deltaX = (int) (x - downX);
320
- final int deltaY = (int) (y - downY);
321
- int distance = (deltaX * deltaX) + (deltaY * deltaY);
+ double distance = Math.hypot(x - downX, y - downY);
322
isInTapRegion = distance > scaledTouchSlop;
323
// If we saw a down/up pair without the value changing, assume
324
// this is a single-tap selection and force a change.
0 commit comments