diff options
| author | 2021-02-10 16:18:04 -0800 | |
|---|---|---|
| committer | 2021-02-10 16:18:04 -0800 | |
| commit | f45228ff1d91e019f2ae01a04fa2eaf04bd08abc (patch) | |
| tree | ce1dadd8d93b3271c0b5d614be621e41f1360289 | |
| parent | 17e971d53101bf5cc4223beb16c79820b3ad5200 (diff) | |
PiP: Snap to closest edge when releasing during a pinch-resize.
Bug: 178881304
Test: Manual
Change-Id: Ibbc1c5bebe2e742fe55bbad44f9b2a9b530b71c7
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipResizeGestureHandler.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipResizeGestureHandler.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipResizeGestureHandler.java index 53571ff70c6f..1ef9ffa494f4 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipResizeGestureHandler.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipResizeGestureHandler.java @@ -558,8 +558,8 @@ public class PipResizeGestureHandler { || mLastResizeBounds.height() >= PINCH_RESIZE_AUTO_MAX_RATIO * mMaxSize.y) { mLastResizeBounds.set(0, 0, mMaxSize.x, mMaxSize.y); } - mPipBoundsAlgorithm.applySnapFraction(mLastResizeBounds, - mPipBoundsAlgorithm.getSnapFraction(mPipBoundsState.getBounds())); + final float snapFraction = mPipBoundsAlgorithm.getSnapFraction(mLastResizeBounds); + mPipBoundsAlgorithm.applySnapFraction(mLastResizeBounds, snapFraction); mPipTaskOrganizer.scheduleAnimateResizePip(startBounds, mLastResizeBounds, PINCH_RESIZE_SNAP_DURATION, -mAngle, callback); } else { |