diff options
author | Selim Cinek <cinek@google.com> | 2014-03-24 16:50:53 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-03-24 16:50:53 +0000 |
commit | 1f4d0b9d377753b1ea37890e32c6034865a39339 (patch) | |
tree | 2fa504acf57a932bcd835c4f00288fc8039c4bd6 | |
parent | 620e1d07de90df7237cf3a13d2f57460bf194d34 (diff) | |
parent | 68f8cf930a49cdf8db71c612f5bc5a64ff91902b (diff) | |
download | android_packages_apps_Trebuchet-1f4d0b9d377753b1ea37890e32c6034865a39339.tar.gz android_packages_apps_Trebuchet-1f4d0b9d377753b1ea37890e32c6034865a39339.tar.bz2 android_packages_apps_Trebuchet-1f4d0b9d377753b1ea37890e32c6034865a39339.zip |
am 68f8cf93: am 7c989e90: Fixed wallpaper bug where wrong size was taken when cropping
* commit '68f8cf930a49cdf8db71c612f5bc5a64ff91902b':
Fixed wallpaper bug where wrong size was taken when cropping
-rw-r--r-- | WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java b/WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java index 1f35622af..08913b67f 100644 --- a/WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java +++ b/WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java @@ -367,17 +367,19 @@ 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 }; |