OSDN Git Service

Fix inverted panorama preview
authorJohn Reck <jreck@google.com>
Wed, 10 Oct 2012 05:10:13 +0000 (22:10 -0700)
committerJohn Reck <jreck@google.com>
Wed, 10 Oct 2012 05:12:29 +0000 (22:12 -0700)
 Bug: 7314703
 Panorama only support rotations of 0 and 90, so if it is greater
 than that flip the output surface texture

Change-Id: I9885feb88d2d1c3e0dabaa7ecd8db66c2ddfb93b

src/com/android/gallery3d/ui/PhotoView.java

index 3086b24..214d0e0 100644 (file)
@@ -546,6 +546,10 @@ public class PhotoView extends GLView {
     }
 
     private int getPanoramaRotation() {
+        // Panorama only support rotations of 0 and 90, so if it is greater
+        // than that flip the output surface texture to compensate
+        if (mDisplayRotation > 180)
+            return (mCompensation + 180) % 360;
         return mCompensation;
     }