diff options
| author | 2024-05-14 15:31:38 -0700 | |
|---|---|---|
| committer | 2024-05-14 22:45:09 +0000 | |
| commit | d2e8dfa37b7cb9cae5261889bcffedd2c7570ef4 (patch) | |
| tree | fc745003d58c19db8c2332e54c6a75911e4e4936 | |
| parent | 6b591573cfdecea1f36410d087a7a1e3715aa903 (diff) | |
Cap scale when swiping to PiP
If the source rect hint is off by a couple pixels
from the app bounds we run a different scale-crop
animation than to when it perfectly fits the screen
along one axis.
We need to make sure that in cases such as this one,
we do not go over scale=1.0 in any case. Since this
path is only triggered when source-rect-hint is valid
and larger than the destination bounds, such assumption
should be safe.
Recordings:
Folded: http://recall/-/BSXDRqFG6tqOB9EtbTyBy/NPnVIYg77S7d7Fjlm9zol
Unfolded: http://recall/-/BSXDRqFG6tqOB9EtbTyBy/ekZHmCyApxeHf7X9RNOpXI
Flag: N/A
Bug: 340024197
Test: repro the steps in the bug report
Change-Id: I2a9012511b7567ef4d08aa60de8b1a9992f99c58
| -rw-r--r-- | packages/SystemUI/shared/src/com/android/systemui/shared/pip/PipSurfaceTransactionHelper.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/pip/PipSurfaceTransactionHelper.java b/packages/SystemUI/shared/src/com/android/systemui/shared/pip/PipSurfaceTransactionHelper.java index 8ac1de898be8..c33b7ce1d002 100644 --- a/packages/SystemUI/shared/src/com/android/systemui/shared/pip/PipSurfaceTransactionHelper.java +++ b/packages/SystemUI/shared/src/com/android/systemui/shared/pip/PipSurfaceTransactionHelper.java @@ -99,7 +99,7 @@ public class PipSurfaceTransactionHelper { final float startScale = sourceRectHint.width() <= sourceRectHint.height() ? (float) destinationBounds.width() / sourceBounds.width() : (float) destinationBounds.height() / sourceBounds.height(); - scale = (1 - progress) * startScale + progress * endScale; + scale = Math.min((1 - progress) * startScale + progress * endScale, 1.0f); } final float left = destinationBounds.left - (insets.left + sourceBounds.left) * scale; final float top = destinationBounds.top - (insets.top + sourceBounds.top) * scale; |