OSDN Git Service

Fix rounding issue affecting TinyPlanet
authornicolasroard <nicolasroard@google.com>
Sat, 27 Oct 2012 17:54:18 +0000 (10:54 -0700)
committernicolasroard <nicolasroard@google.com>
Sat, 27 Oct 2012 17:54:18 +0000 (10:54 -0700)
bug:7428061
Change-Id: Ieeb4c27d4c426d7052c49ca88ca61ff0785000a3

src/com/android/gallery3d/filtershow/imageshow/GeometryMetadata.java

index 77e78fe..24586e7 100644 (file)
@@ -18,12 +18,11 @@ package com.android.gallery3d.filtershow.imageshow;
 
 import android.graphics.Bitmap;
 import android.graphics.Matrix;
+import android.graphics.Rect;
 import android.graphics.RectF;
 
 import com.android.gallery3d.filtershow.filters.ImageFilterGeometry;
 
-import java.util.Arrays;
-
 public class GeometryMetadata {
     // Applied in order: rotate, crop, scale.
     // Do not scale saved image (presumably?).
@@ -59,7 +58,11 @@ public class GeometryMetadata {
         if (mStraightenRotation != 0) {
             return true;
         }
-        if (!mCropBounds.equals(mPhotoBounds)) {
+        Rect cropBounds = new Rect();
+        mCropBounds.roundOut(cropBounds);
+        Rect photoBounds = new Rect();
+        mPhotoBounds.roundOut(photoBounds);
+        if (!cropBounds.equals(photoBounds)) {
             return true;
         }
         if (!mFlip.equals(FLIP.NONE)){