diff options
author | andralex8 <andralex8@gmail.com> | 2017-05-28 16:56:39 +0200 |
---|---|---|
committer | Michael Bestas <mkbestas@lineageos.org> | 2017-06-26 23:25:31 +0000 |
commit | 25a16bc1cd3c58c4120e5eaf2796f9d7a8f863e3 (patch) | |
tree | da64a69e76fb1a5e3c1de48f3da57d46ec959b1a /src/com/android/camera/VideoUI.java | |
parent | 0a068b647a0fce069ad7990009954940c05ad79f (diff) | |
download | android_packages_apps_Snap-25a16bc1cd3c58c4120e5eaf2796f9d7a8f863e3.tar.gz android_packages_apps_Snap-25a16bc1cd3c58c4120e5eaf2796f9d7a8f863e3.tar.bz2 android_packages_apps_Snap-25a16bc1cd3c58c4120e5eaf2796f9d7a8f863e3.zip |
Add orientation correction for landscape devices
Snap does not correctly handle devices with a landscape screen as rotation
is 0 when device is in landscape while Snap assume that 0 is portrait.
This lead to a rotated gui and a deformed preview.
This commit:
- Solve the gui rotation for Photo, Video and Panorama modules
- Solve the deformed preview for Photo and Video (Panorama preview was ok with gui fix)
- Solve the PhotoMenu rotation (all devices, it was also broken on portrait devices)
Change-Id: Ic0b95904da6e13946c7e46e2e571b26da498db02
Diffstat (limited to 'src/com/android/camera/VideoUI.java')
-rw-r--r-- | src/com/android/camera/VideoUI.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/com/android/camera/VideoUI.java b/src/com/android/camera/VideoUI.java index a5ec680dd..fa3f69f4d 100644 --- a/src/com/android/camera/VideoUI.java +++ b/src/com/android/camera/VideoUI.java @@ -351,6 +351,9 @@ public class VideoUI implements PieRenderer.PieListener, float scaledTextureWidth = 0.0f, scaledTextureHeight = 0.0f; int rotation = CameraUtil.getDisplayRotation(mActivity); + if(!CameraUtil.isDefaultToPortrait(mActivity)) { + rotation = (rotation - 90) % 360; + } if (mScreenRatio == CameraUtil.RATIO_16_9 && CameraUtil.determinCloseRatio(ratio) == CameraUtil.RATIO_4_3) { int l = (mTopMargin + mBottomMargin) * 4; |