summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/filtershow/filters/ImageFilterGeometry.java
diff options
context:
space:
mode:
authornicolasroard <nicolasroard@google.com>2012-10-13 17:24:31 -0700
committernicolasroard <nicolasroard@google.com>2012-10-13 17:24:31 -0700
commit1c44be4899c454e359cdde0b62f7678c59e0a8fa (patch)
tree83483139025db452a12335432f263f9da1017e5a /src/com/android/gallery3d/filtershow/filters/ImageFilterGeometry.java
parentb3e8fc2def7b3995c3b558d8594eb573defedf82 (diff)
downloadandroid_packages_apps_Snap-1c44be4899c454e359cdde0b62f7678c59e0a8fa.tar.gz
android_packages_apps_Snap-1c44be4899c454e359cdde0b62f7678c59e0a8fa.tar.bz2
android_packages_apps_Snap-1c44be4899c454e359cdde0b62f7678c59e0a8fa.zip
Fix cropping and saving issues
bug:7342359 Change-Id: Ia59eb3f423b8c4f420b7b6f120735856a84cd854
Diffstat (limited to 'src/com/android/gallery3d/filtershow/filters/ImageFilterGeometry.java')
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterGeometry.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilterGeometry.java b/src/com/android/gallery3d/filtershow/filters/ImageFilterGeometry.java
index 9bdffee2e..3d48b7e53 100644
--- a/src/com/android/gallery3d/filtershow/filters/ImageFilterGeometry.java
+++ b/src/com/android/gallery3d/filtershow/filters/ImageFilterGeometry.java
@@ -84,9 +84,9 @@ public class ImageFilterGeometry extends ImageFilter {
// canvas to do a simple implementation...
// TODO: and be more memory efficient! (do it in native?)
Rect cropBounds = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());
- RectF c = mGeometry.getCropBounds();
- if(c != null && c.width() > 0 && c.height() > 0)
- c.roundOut(cropBounds);
+ RectF crop = mGeometry.getCropBounds(bitmap);
+ if(crop.width() > 0 && crop.height() > 0)
+ crop.roundOut(cropBounds);
Bitmap temp = null;
if (mGeometry.hasSwitchedWidthHeight()) {
temp = Bitmap.createBitmap(cropBounds.height(), cropBounds.width(), mConfig);
@@ -94,7 +94,7 @@ public class ImageFilterGeometry extends ImageFilter {
temp = Bitmap.createBitmap(cropBounds.width(), cropBounds.height(), mConfig);
}
- Matrix drawMatrix = buildMatrix(c);
+ Matrix drawMatrix = buildMatrix(crop);
Canvas canvas = new Canvas(temp);
canvas.drawBitmap(bitmap, drawMatrix, new Paint());
return temp;