summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/DragLayer.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/launcher3/DragLayer.java')
-rw-r--r--src/com/android/launcher3/DragLayer.java3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/com/android/launcher3/DragLayer.java b/src/com/android/launcher3/DragLayer.java
index ab2e094cb..91f97fa4a 100644
--- a/src/com/android/launcher3/DragLayer.java
+++ b/src/com/android/launcher3/DragLayer.java
@@ -657,8 +657,7 @@ public class DragLayer extends InsettableFrameLayout {
final Runnable onCompleteRunnable, final int animationEndStyle, View anchorView) {
// Calculate the duration of the animation based on the object's distance
- final float dist = (float) Math.sqrt(Math.pow(to.left - from.left, 2) +
- Math.pow(to.top - from.top, 2));
+ final float dist = (float) Math.hypot(to.left - from.left, to.top - from.top);
final Resources res = getResources();
final float maxDist = (float) res.getInteger(R.integer.config_dropAnimMaxDist);