diff options
author | Owen Lin <owenlin@google.com> | 2010-03-06 11:18:18 +0800 |
---|---|---|
committer | Owen Lin <owenlin@google.com> | 2010-03-10 16:19:54 +0800 |
commit | 33be45a1abaf6a8d611fb87b18945c84ab76c229 (patch) | |
tree | 1f17fd3321761df9b3374654315d14cd898d8720 /src/com/android/camera/Util.java | |
parent | 8e5c4413072e5d69b0f413940f1ae448202949db (diff) | |
download | LegacyCamera-33be45a1abaf6a8d611fb87b18945c84ab76c229.zip LegacyCamera-33be45a1abaf6a8d611fb87b18945c84ab76c229.tar.gz LegacyCamera-33be45a1abaf6a8d611fb87b18945c84ab76c229.tar.bz2 |
Add the new ZoomController UI and also the exposure compensation settings.
Fix the bug that some MotionEvent of some actions should always pass to the
component who accept the DOWN event.
Also fix a bug that nine patch image will be drawn incorrectly after rotation.
Change-Id: I8ab36fb6f958c1967afa11eed5f167842b59cada
Diffstat (limited to 'src/com/android/camera/Util.java')
-rw-r--r-- | src/com/android/camera/Util.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/com/android/camera/Util.java b/src/com/android/camera/Util.java index d2914f3..54c1e4d 100644 --- a/src/com/android/camera/Util.java +++ b/src/com/android/camera/Util.java @@ -264,4 +264,16 @@ public class Util { n |= n >>> 1; return n + 1; } + + public static float distance(float x, float y, float sx, float sy) { + float dx = x - sx; + float dy = y - sy; + return (float) Math.sqrt(dx * dx + dy * dy); + } + + public static int clamp(int x, int min, int max) { + if (x > max) return max; + if (x < min) return min; + return x; + } } |