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

Skip to content
Commit 9f608cfa authored by Hongwei Wang's avatar Hongwei Wang
Browse files

[1/N] Check destination against src aspect ratio

This is the fix on SystemUI side. There is a counterpart on
Launcher side.

PictureInPictureParams#isSameAspectRatio has 1-pixel allowance when
comparing a given Rect against the aspect ratio.

When we compare the source rect hint against the aspect ratio inferred
from the destination bounds, the float error during the destination
bounds calculation is amped. For instance:

- Source rect hint: Rect(152, 0 - 2072, 1080), 1920x1080
- Destination bounds: Rect(440, 1218 - 1038, 1554), 598x336

When do the isSameAspectRatio

- If we fix the height=1080, expected width=1922, it's 2 pixels off
- If we fix the width=1920, expected height=1078, it's 2 pixels off

The check would fail. Instead, in this change, we compare the
destination bounds against the aspect ratio from the source rect hint.
For the same source rect hint and destination bounds

- If we fix the height=336, expected width=597, it's 1 pixel off
- If we fix the width=598, expect height=336, it's 0 pixel off

Note: this change applies to both PiP1 and PiP2

Flag: EXEMPT bugfix
Bug: 402190788
Video: http://recall/-/aaaaaabFQoRHlzixHdtY/cUXaoJxzXDdKdSyqkQZOG1
Test: Swipe to enter PiP from landscape playback, see also Video
Change-Id: I02d6ddf2d0f2ffdc2e33c52ff9577fcba07d26ce
parent 35b49cff
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment