summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/filtershow/filters/ImageFilterGeometry.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/gallery3d/filtershow/filters/ImageFilterGeometry.java')
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterGeometry.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilterGeometry.java b/src/com/android/gallery3d/filtershow/filters/ImageFilterGeometry.java
index 04057681f..bdcb0ea4e 100644
--- a/src/com/android/gallery3d/filtershow/filters/ImageFilterGeometry.java
+++ b/src/com/android/gallery3d/filtershow/filters/ImageFilterGeometry.java
@@ -23,6 +23,7 @@ import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.RectF;
+import com.android.gallery3d.filtershow.imageshow.GeometryMath;
import com.android.gallery3d.filtershow.imageshow.GeometryMetadata;
public class ImageFilterGeometry extends ImageFilter {
@@ -78,19 +79,18 @@ public class ImageFilterGeometry extends ImageFilter {
} else {
temp = Bitmap.createBitmap(cropBounds.width(), cropBounds.height(), mConfig);
}
+ float[] displayCenter = {
+ temp.getWidth() / 2f, temp.getHeight() / 2f
+ };
+
+ Matrix m1 = mGeometry.buildTotalXform(bitmap.getWidth(), bitmap.getHeight(), displayCenter);
- RectF rp = mGeometry.getPhotoBounds();
- RectF rc = mGeometry.getPreviewCropBounds();
- Matrix drawMatrix = mGeometry.buildTotalXform(rp.width(), rp.height(), rc.width(),
- rc.height(), rc.left, rc.top,
- mGeometry.getRotation(), mGeometry.getStraightenRotation(),
- bitmap.getWidth() / rp.width(), null);
Canvas canvas = new Canvas(temp);
Paint paint = new Paint();
paint.setAntiAlias(true);
paint.setFilterBitmap(true);
paint.setDither(true);
- canvas.drawBitmap(bitmap, drawMatrix, paint);
+ canvas.drawBitmap(bitmap, m1, paint);
return temp;
}