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

Commit 0f93dc6e authored by PlayfulGod's avatar PlayfulGod
Browse files

fix for screenshot animation glitch in portrait

edits by Stefano Semeraro aka Suxsem.

Change-Id: I7a03a24c5b1bfdfe616f940b2bd7be42091f45a6
parent bb0c0ab9
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);