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

Commit cfc233dc authored by Ricardo Cerqueira's avatar Ricardo Cerqueira Committed by Gerrit Code Review
Browse files

Merge "fix for screenshot animation glitch in portrait" into cm-11.0

parents a8f92a9f 0f93dc6e
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -464,20 +464,23 @@ class GlobalScreenshot {
            return;
        }

        if (requiresRotation) {
            // Rotate the screenshot to the current orientation
        Bitmap ss = Bitmap.createBitmap(mDisplayMetrics.widthPixels,
                mDisplayMetrics.heightPixels, Bitmap.Config.ARGB_8888);
        Canvas c = new Canvas(ss);

        if (requiresRotation) {
            // Rotate the screenshot to the current orientation
            c.translate(ss.getWidth() / 2, ss.getHeight() / 2);
            c.rotate(degrees);
            c.translate(-dims[0] / 2, -dims[1] / 2);
        }

        c.drawBitmap(mScreenBitmap, 0, 0, null);
        c.setBitmap(null);

        // Recycle the previous bitmap
        mScreenBitmap.recycle();
        mScreenBitmap = ss;
        }

        // Optimizations
        mScreenBitmap.setHasAlpha(false);