summaryrefslogtreecommitdiffstats
path: root/packages/WallpaperCropper
diff options
context:
space:
mode:
authorSelim Cinek <cinek@google.com>2014-03-25 21:18:45 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-03-25 21:18:45 +0000
commit92a87e302625c69c6a52c3cb595b9ecfacf29129 (patch)
tree80ab65033db9b57d02f5b4e1e2199b5b30eb960d /packages/WallpaperCropper
parentf53d1a01972d04402b48476d6a8173285516edd3 (diff)
parent50cd7c39bb9f62d443a62d1f4af7f6ebc107f217 (diff)
downloadframeworks_base-92a87e302625c69c6a52c3cb595b9ecfacf29129.zip
frameworks_base-92a87e302625c69c6a52c3cb595b9ecfacf29129.tar.gz
frameworks_base-92a87e302625c69c6a52c3cb595b9ecfacf29129.tar.bz2
am 50cd7c39: am f7805dd7: am 7290b56b: am 8ae8689d: am c41853ce: Fixed wallpaper bug where wrong size was taken when cropping
* commit '50cd7c39bb9f62d443a62d1f4af7f6ebc107f217': Fixed wallpaper bug where wrong size was taken when cropping
Diffstat (limited to 'packages/WallpaperCropper')
-rw-r--r--packages/WallpaperCropper/src/com/android/wallpapercropper/WallpaperCropActivity.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/packages/WallpaperCropper/src/com/android/wallpapercropper/WallpaperCropActivity.java b/packages/WallpaperCropper/src/com/android/wallpapercropper/WallpaperCropActivity.java
index d6c0c99..fb002d2 100644
--- a/packages/WallpaperCropper/src/com/android/wallpapercropper/WallpaperCropActivity.java
+++ b/packages/WallpaperCropper/src/com/android/wallpapercropper/WallpaperCropActivity.java
@@ -363,16 +363,17 @@ public class WallpaperCropActivity extends Activity {
// Get the crop
RectF cropRect = mCropView.getCrop();
+ Point inSize = mCropView.getSourceDimensions();
+
// Due to rounding errors in the cropview renderer the edges can be slightly offset
// therefore we ensure that the boundaries are sanely defined
cropRect.left = Math.max(0, cropRect.left);
- cropRect.right = Math.min(mCropView.getWidth(), cropRect.right);
+ cropRect.right = Math.min(inSize.x, cropRect.right);
cropRect.top = Math.max(0, cropRect.top);
- cropRect.bottom = Math.min(mCropView.getHeight(), cropRect.bottom);
+ cropRect.bottom = Math.min(inSize.y, cropRect.bottom);
int cropRotation = mCropView.getImageRotation();
float cropScale = mCropView.getWidth() / (float) cropRect.width();
- Point inSize = mCropView.getSourceDimensions();
Matrix rotateMatrix = new Matrix();
rotateMatrix.setRotate(cropRotation);
float[] rotatedInSize = new float[] { inSize.x, inSize.y };