diff options
author | Angus Kong <shkong@google.com> | 2014-04-24 15:46:52 -0700 |
---|---|---|
committer | Angus Kong <shkong@google.com> | 2014-04-24 16:27:24 -0700 |
commit | 00b7b10987b38c362cc88600aad58890d531bf35 (patch) | |
tree | 3dd5d2be165aef4f4657269ec87727330e3d8efb /src/com/android/camera/util/CameraUtil.java | |
parent | 2c6eabec7edbfa159e207449d575fa7bb64a9470 (diff) | |
download | android_packages_apps_Camera2-00b7b10987b38c362cc88600aad58890d531bf35.tar.gz android_packages_apps_Camera2-00b7b10987b38c362cc88600aad58890d531bf35.tar.bz2 android_packages_apps_Camera2-00b7b10987b38c362cc88600aad58890d531bf35.zip |
Use Point to back up util.Size.
Change-Id: I125d290ee94c9acadf77c50c6c9c0b9b24df4a88
Diffstat (limited to 'src/com/android/camera/util/CameraUtil.java')
-rw-r--r-- | src/com/android/camera/util/CameraUtil.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/com/android/camera/util/CameraUtil.java b/src/com/android/camera/util/CameraUtil.java index 7f4a8c503..4aafead42 100644 --- a/src/com/android/camera/util/CameraUtil.java +++ b/src/com/android/camera/util/CameraUtil.java @@ -479,7 +479,7 @@ public class CameraUtil { int index = 0; for (Size s : sizes) { - points[index++] = new Point(s.width, s.height); + points[index++] = new Point(s.width(), s.height()); } int optimalPickIndex = getOptimalPreviewSize(context, points, targetRatio); @@ -503,7 +503,7 @@ public class CameraUtil { // new overlay will be created before the old one closed, which causes // an exception. For now, just get the screen size. Size defaultDisplaySize = getDefaultDisplaySize(context, new Point()); - int targetHeight = Math.min(defaultDisplaySize.width, defaultDisplaySize.height); + int targetHeight = Math.min(defaultDisplaySize.width(), defaultDisplaySize.height()); // Try to find an size match aspect ratio and size for (int i = 0; i < sizes.length; i++) { Point size = sizes[i]; @@ -545,11 +545,11 @@ public class CameraUtil { // Try to find a size matches aspect ratio and has the largest width for (Size size : sizes) { - double ratio = (double) size.width / size.height; + double ratio = (double) size.width() / size.height(); if (Math.abs(ratio - targetRatio) > ASPECT_TOLERANCE) { continue; } - if (optimalSize == null || size.width > optimalSize.width) { + if (optimalSize == null || size.width() > optimalSize.width()) { optimalSize = size; } } @@ -559,7 +559,7 @@ public class CameraUtil { if (optimalSize == null) { Log.w(TAG, "No picture size match the aspect ratio"); for (Size size : sizes) { - if (optimalSize == null || size.width > optimalSize.width) { + if (optimalSize == null || size.width() > optimalSize.width()) { optimalSize = size; } } |