summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/PhotoUI.java
diff options
context:
space:
mode:
authorNikita <nikich340@gmail.com>2016-02-23 15:19:23 +1000
committerChippa-a <vusal1372@gmail.com>2019-10-25 15:55:25 +0300
commit18d0925f4ebf538adc4565e9458fc0ad15c05345 (patch)
tree057bb1489648dad84553dd35bae737cf07b38a09 /src/com/android/camera/PhotoUI.java
parent9555a08b12c2785736478a4b385c3416238c7b0d (diff)
downloadandroid_packages_apps_Snap-18d0925f4ebf538adc4565e9458fc0ad15c05345.tar.gz
android_packages_apps_Snap-18d0925f4ebf538adc4565e9458fc0ad15c05345.tar.bz2
android_packages_apps_Snap-18d0925f4ebf538adc4565e9458fc0ad15c05345.zip
Snap: Fix incorrect preview layout surface size in landscape mode
If height is smaller than width it means that orientation sets to horizontal and we should decrease width instead height to get normal preview size. Change-Id: Ifa211ad2604fb730fb85b01ae1d7c93c9b7aa2ce
Diffstat (limited to 'src/com/android/camera/PhotoUI.java')
-rwxr-xr-xsrc/com/android/camera/PhotoUI.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java
index 61ea9f93b..5daab2f91 100755
--- a/src/com/android/camera/PhotoUI.java
+++ b/src/com/android/camera/PhotoUI.java
@@ -395,8 +395,13 @@ public class PhotoUI implements PieListener,
} else {
float width = mMaxPreviewWidth, height = mMaxPreviewHeight;
if (width == 0 || height == 0) return;
- if(mScreenRatio == CameraUtil.RATIO_4_3)
- height -= (mTopMargin + mBottomMargin);
+ if (mScreenRatio == CameraUtil.RATIO_4_3) {
+ if (height > width) {
+ height -= (mTopMargin + mBottomMargin);
+ } else {
+ width -= (mTopMargin + mBottomMargin);
+ }
+ }
if (mOrientationResize) {
scaledTextureWidth = height * mAspectRatio;
if (scaledTextureWidth > width) {