summaryrefslogtreecommitdiffstats
path: root/packages/WallpaperCropper
diff options
context:
space:
mode:
authorSelim Cinek <cinek@google.com>2014-03-27 23:16:51 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-03-27 23:16:51 +0000
commit49fb8aeff5b1ee928f698860c1915b742a3adbf7 (patch)
treee7d3a44ef87fcb3934496ee583cb074457677f6b /packages/WallpaperCropper
parent7c495dcd11d64f1630bd1ebaa9259508c1175621 (diff)
parentc3db8011d7f7a5bcb0a9e5ae2d20022c6e88d8f9 (diff)
downloadframeworks_base-49fb8aeff5b1ee928f698860c1915b742a3adbf7.zip
frameworks_base-49fb8aeff5b1ee928f698860c1915b742a3adbf7.tar.gz
frameworks_base-49fb8aeff5b1ee928f698860c1915b742a3adbf7.tar.bz2
am c3db8011: am 58e99f56: am b6e077dc: am 7718fc12: Fixed crash when setting wallpaper with built in rotation
* commit 'c3db8011d7f7a5bcb0a9e5ae2d20022c6e88d8f9': Fixed crash when setting wallpaper with built in rotation
Diffstat (limited to 'packages/WallpaperCropper')
-rw-r--r--packages/WallpaperCropper/src/com/android/wallpapercropper/WallpaperCropActivity.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/packages/WallpaperCropper/src/com/android/wallpapercropper/WallpaperCropActivity.java b/packages/WallpaperCropper/src/com/android/wallpapercropper/WallpaperCropActivity.java
index fb002d2..5c8a8ef 100644
--- a/packages/WallpaperCropper/src/com/android/wallpapercropper/WallpaperCropActivity.java
+++ b/packages/WallpaperCropper/src/com/android/wallpapercropper/WallpaperCropActivity.java
@@ -365,12 +365,6 @@ public class WallpaperCropActivity extends Activity {
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(inSize.x, cropRect.right);
- cropRect.top = Math.max(0, cropRect.top);
- cropRect.bottom = Math.min(inSize.y, cropRect.bottom);
int cropRotation = mCropView.getImageRotation();
float cropScale = mCropView.getWidth() / (float) cropRect.width();
@@ -381,6 +375,13 @@ public class WallpaperCropActivity extends Activity {
rotatedInSize[0] = Math.abs(rotatedInSize[0]);
rotatedInSize[1] = Math.abs(rotatedInSize[1]);
+ // 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(rotatedInSize[0], cropRect.right);
+ cropRect.top = Math.max(0, cropRect.top);
+ cropRect.bottom = Math.min(rotatedInSize[1], cropRect.bottom);
+
// ADJUST CROP WIDTH
// Extend the crop all the way to the right, for parallax
// (or all the way to the left, in RTL)