diff options
Diffstat (limited to 'test-runner')
-rw-r--r-- | test-runner/src/android/test/TouchUtils.java | 4 |
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 acbde0b..0fbffcd 100644 --- a/test-runner/src/android/test/TouchUtils.java +++ b/test-runner/src/android/test/TouchUtils.java @@ -576,7 +576,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); @@ -629,7 +629,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; |