summaryrefslogtreecommitdiffstats
path: root/WallpaperPicker
diff options
context:
space:
mode:
authorSelim Cinek <cinek@google.com>2014-03-27 20:35:19 +0100
committerSelim Cinek <cinek@google.com>2014-03-27 20:35:19 +0100
commit314425602a7ccd9cc2bdef1a11f5e51211201b6f (patch)
tree84a0d4414b48d1aca3bd6c84d10bcb69dcc1bd63 /WallpaperPicker
parent7c989e90e84b29f4762abaf2c80ecafc1a9e99d4 (diff)
downloadandroid_packages_apps_Trebuchet-314425602a7ccd9cc2bdef1a11f5e51211201b6f.tar.gz
android_packages_apps_Trebuchet-314425602a7ccd9cc2bdef1a11f5e51211201b6f.tar.bz2
android_packages_apps_Trebuchet-314425602a7ccd9cc2bdef1a11f5e51211201b6f.zip
Fixed crash when setting wallpaper with built in rotation
If an image had a built-in rotation, a crash could occur, when setting it. An example was a panorama image which had a rotation of 90 degrees. Change-Id: Iede8226dac3a40f08d39a69162eb388e6aba97ec Bug: 13507421
Diffstat (limited to 'WallpaperPicker')
-rw-r--r--WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java b/WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java
index 08913b67f..11684c3a0 100644
--- a/WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java
+++ b/WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java
@@ -369,13 +369,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();
@@ -387,6 +380,14 @@ 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)