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

Commit 28637bac authored by Jim Miller's avatar Jim Miller
Browse files

Fix 4689527: Fix rendering issue with thumbnails on phones

This fixes a bug where the phone thumbnail scale was being miscalculated
for the square aspect of thumbnails on phones.  The code now constrains
thumbnails to fit the smaller of screen width and screen height.

Change-Id: I174abacd4cf3dcf124e10fe8980fb01fe299ec6a
parent f03712bf
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -4886,8 +4886,13 @@ public class WindowManagerService extends IWindowManager.Stub
            int fw = frame.width();
            int fh = frame.height();

            // First try reducing to fit in x dimension.
            scale = width/(float)fw;
            // Constrain thumbnail to smaller of screen width or height. Assumes aspect
            // of thumbnail is the same as the screen (in landscape) or square.
            if (dw <= dh) {
                scale = width / (float) fw; // portrait
            } else {
                scale = height / (float) fh; // landscape
            }

            // The screen shot will contain the entire screen.
            dw = (int)(dw*scale);