diff options
author | Chung-yih Wang <cywang@google.com> | 2011-09-07 17:56:47 +0800 |
---|---|---|
committer | Chung-yih Wang <cywang@google.com> | 2011-09-07 17:56:47 +0800 |
commit | f09f58c11f3e6b5670cfb1317bb2d7cf1e412d7c (patch) | |
tree | de75a2af023b05ee92684facc7ffacaaba5c9bdd /src/com/android/camera/ui/ZoomControl.java | |
parent | 03e53d81e5d64542fba64565962b9c0049525f71 (diff) | |
download | packages_apps_LegacyCamera-f09f58c11f3e6b5670cfb1317bb2d7cf1e412d7c.zip packages_apps_LegacyCamera-f09f58c11f3e6b5670cfb1317bb2d7cf1e412d7c.tar.gz packages_apps_LegacyCamera-f09f58c11f3e6b5670cfb1317bb2d7cf1e412d7c.tar.bz2 |
Fix Divide-By-Zero bugs.
bug:5261752
Change-Id: I780e1e1187242b6f44e6844b92b7a9eac2d3b1d1
Diffstat (limited to 'src/com/android/camera/ui/ZoomControl.java')
-rw-r--r-- | src/com/android/camera/ui/ZoomControl.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/com/android/camera/ui/ZoomControl.java b/src/com/android/camera/ui/ZoomControl.java index 6ab2573..be2bdb9 100644 --- a/src/com/android/camera/ui/ZoomControl.java +++ b/src/com/android/camera/ui/ZoomControl.java @@ -130,7 +130,11 @@ public abstract class ZoomControl extends RelativeLayout { } mZoomIndex = index; if (mIndexListener != null) { - mIndexListener.onZoomIndexChanged(1.0d * mZoomIndex / mZoomMax); + if (mZoomMax == 0) { + mIndexListener.onZoomIndexChanged(0.0d); + } else { + mIndexListener.onZoomIndexChanged(1.0d * mZoomIndex / mZoomMax); + } } invalidate(); } |