diff options
author | andralex8 <andralex8@gmail.com> | 2017-05-28 16:56:39 +0200 |
---|---|---|
committer | Chippa-a <vusal1372@gmail.com> | 2019-10-25 15:55:25 +0300 |
commit | c4d80506754415446b575f566911890c15016953 (patch) | |
tree | 5bcc9e597ac702d2a244bfefed7a03f0e24247cf /src/com/android/camera/VideoUI.java | |
parent | aba0a162b09dc1bb1246e5f558a01a4b28d24f0d (diff) | |
download | android_packages_apps_Snap-c4d80506754415446b575f566911890c15016953.tar.gz android_packages_apps_Snap-c4d80506754415446b575f566911890c15016953.tar.bz2 android_packages_apps_Snap-c4d80506754415446b575f566911890c15016953.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')
-rwxr-xr-x | 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 6138e5acb..bf5e4ffc6 100755 --- a/src/com/android/camera/VideoUI.java +++ b/src/com/android/camera/VideoUI.java @@ -400,6 +400,9 @@ public class VideoUI implements PieRenderer.PieListener, float scaledTextureWidth, scaledTextureHeight; int rotation = CameraUtil.getDisplayRotation(mActivity); + if (!CameraUtil.isDefaultToPortrait(mActivity)) { + rotation = (rotation - 90) % 360; + } mScreenRatio = CameraUtil.determineRatio(ratio); if (mScreenRatio == CameraUtil.RATIO_16_9 && CameraUtil.determinCloseRatio(ratio) == CameraUtil.RATIO_4_3) { |