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

Commit 8ae8689d authored by Selim Cinek's avatar Selim Cinek Committed by Android Git Automerger
Browse files

am c41853ce: Fixed wallpaper bug where wrong size was taken when cropping

* commit 'c41853ce':
  Fixed wallpaper bug where wrong size was taken when cropping
parents e05077d7 c41853ce
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -346,16 +346,17 @@ 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 };