From c4d80506754415446b575f566911890c15016953 Mon Sep 17 00:00:00 2001 From: andralex8 Date: Sun, 28 May 2017 16:56:39 +0200 Subject: 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 --- src/com/android/camera/VideoUI.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/com/android/camera/VideoUI.java') 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) { -- cgit v1.2.3