summaryrefslogtreecommitdiffstats
path: root/test-runner
diff options
context:
space:
mode:
Diffstat (limited to 'test-runner')
-rw-r--r--test-runner/src/android/test/TouchUtils.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/test-runner/src/android/test/TouchUtils.java b/test-runner/src/android/test/TouchUtils.java
index 67a0bc2..1b854b0 100644
--- a/test-runner/src/android/test/TouchUtils.java
+++ b/test-runner/src/android/test/TouchUtils.java
@@ -564,7 +564,7 @@ public class TouchUtils {
final int fromX = xy[0];
final int fromY = xy[1];
- int distance = (int) Math.sqrt(deltaX * deltaX + deltaY * deltaY);
+ int distance = (int) Math.hypot(deltaX, deltaY);
drag(test, fromX, fromX + deltaX, fromY, fromY + deltaY, distance);
@@ -617,7 +617,7 @@ public class TouchUtils {
int deltaX = fromX - toX;
int deltaY = fromY - toY;
- int distance = (int)Math.sqrt(deltaX * deltaX + deltaY * deltaY);
+ int distance = (int)Math.hypot(deltaX, deltaY);
drag(test, fromX, toX, fromY, toY, distance);
return distance;