Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9c3fc0cc authored by Selim Cinek's avatar Selim Cinek Committed by Android Git Automerger
Browse files

am eb95e74e: DO NOT MERGE - Fixed crash for odd image width/height

* commit 'eb95e74e':
  DO NOT MERGE - Fixed crash for odd image width/height
parents 00c7d34c eb95e74e
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -340,6 +340,13 @@ public class WallpaperCropActivity extends Activity {
                getWindowManager());
        // Get the crop
        RectF cropRect = mCropView.getCrop();

        // 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.top = Math.max(0, cropRect.top);
        cropRect.bottom = Math.min(mCropView.getHeight(), cropRect.bottom);
        int cropRotation = mCropView.getImageRotation();
        float cropScale = mCropView.getWidth() / (float) cropRect.width();