diff options
Diffstat (limited to 'src/com/android/gallery3d/filtershow/imageshow/GradControl.java')
-rw-r--r-- | src/com/android/gallery3d/filtershow/imageshow/GradControl.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/com/android/gallery3d/filtershow/imageshow/GradControl.java b/src/com/android/gallery3d/filtershow/imageshow/GradControl.java index 964da99e9..29870154b 100644 --- a/src/com/android/gallery3d/filtershow/imageshow/GradControl.java +++ b/src/com/android/gallery3d/filtershow/imageshow/GradControl.java @@ -110,7 +110,7 @@ public class GradControl { for (int i = 0; i < handlex.length; i++) { float dx = handlex[i] - x; float dy = handley[i] - y; - float dist = (float) Math.sqrt(dx * dx + dy * dy); + float dist = (float) Math.hypot(dx, dy); } return -1; @@ -236,7 +236,7 @@ public class GradControl { float cy = (p1y + p2y) / 2; float dx = p1x - p2x; float dy = p1y - p2y; - float len = (float) Math.sqrt(dx * dx + dy * dy); + float len = (float) Math.hypot(dx, dy); dx *= 2048 / len; dy *= 2048 / len; |