summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/ui/ZoomControl.java
diff options
context:
space:
mode:
authorChung-yih Wang <cywang@google.com>2011-09-07 17:56:47 +0800
committerChung-yih Wang <cywang@google.com>2011-09-07 17:56:47 +0800
commitf09f58c11f3e6b5670cfb1317bb2d7cf1e412d7c (patch)
treede75a2af023b05ee92684facc7ffacaaba5c9bdd /src/com/android/camera/ui/ZoomControl.java
parent03e53d81e5d64542fba64565962b9c0049525f71 (diff)
downloadpackages_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.java6
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();
}