summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorSelim Cinek <cinek@google.com>2014-03-27 22:15:37 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-03-27 22:15:37 +0000
commitb6e077dcbe1034007fd52b48951637a9be4bab74 (patch)
tree9dc250e0a9b06d02ca85adc56c27815dfba63549 /packages
parent22b483ee6e029dc9db4ae390b91c449b7977273d (diff)
parent7718fc1291c73576417f0c25d88f5105f7ae7365 (diff)
downloadframeworks_base-b6e077dcbe1034007fd52b48951637a9be4bab74.zip
frameworks_base-b6e077dcbe1034007fd52b48951637a9be4bab74.tar.gz
frameworks_base-b6e077dcbe1034007fd52b48951637a9be4bab74.tar.bz2
am 7718fc12: Fixed crash when setting wallpaper with built in rotation
* commit '7718fc1291c73576417f0c25d88f5105f7ae7365': Fixed crash when setting wallpaper with built in rotation
Diffstat (limited to 'packages')
-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 757a7a2..a070e5e 100644
--- a/packages/WallpaperCropper/src/com/android/wallpapercropper/WallpaperCropActivity.java
+++ b/packages/WallpaperCropper/src/com/android/wallpapercropper/WallpaperCropActivity.java
@@ -348,12 +348,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();
@@ -364,6 +358,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)