summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/WideAnglePanoramaUI.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/camera/WideAnglePanoramaUI.java')
-rw-r--r--src/com/android/camera/WideAnglePanoramaUI.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/com/android/camera/WideAnglePanoramaUI.java b/src/com/android/camera/WideAnglePanoramaUI.java
index b0f3de40b..1546958de 100644
--- a/src/com/android/camera/WideAnglePanoramaUI.java
+++ b/src/com/android/camera/WideAnglePanoramaUI.java
@@ -434,8 +434,13 @@ public class WideAnglePanoramaUI implements
}
public void flipPreviewIfNeeded() {
- if (CameraUtil.getDisplayRotation(mActivity) >= 180) {
- // In either reverse landscape or reverse portrait
+ // Rotation needed to display image correctly clockwise
+ int cameraOrientation = mController.getCameraOrientation();
+ // Display rotated counter-clockwise
+ int displayRotation = CameraUtil.getDisplayRotation(mActivity);
+ // Rotation needed to display image correctly on current display
+ int rotation = (cameraOrientation - displayRotation + 360) % 360;
+ if (rotation >= 180) {
mTextureView.setRotation(180);
} else {
mTextureView.setRotation(0);