From 47eddecc533e4655828885d47acb7e7e8421c9a8 Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Wed, 15 Feb 2017 19:24:22 -0800 Subject: [PATCH] Pinned stack animation: Correct scaling calculations. Previously we were scaling to the clip rectangle which included the Surface insets. When we changed to scaling to the stack bounds, we didn't update this code, and reversed the insets in a situation they weren't applied. Bug: 35396882 Test: Move skeleton pip app from fullscreen to pip, ensure it reaches correct final size without jump at end. Change-Id: If2dc272f40f90383e35d509f7220c21e0e0be5b1 --- .../core/java/com/android/server/wm/WindowStateAnimator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/wm/WindowStateAnimator.java b/services/core/java/com/android/server/wm/WindowStateAnimator.java index c475d60c9cbb3..24f9ce128ec63 100644 --- a/services/core/java/com/android/server/wm/WindowStateAnimator.java +++ b/services/core/java/com/android/server/wm/WindowStateAnimator.java @@ -1328,8 +1328,8 @@ class WindowStateAnimator { task.mStack.getDimBounds(mTmpStackBounds); // We want to calculate the scaling based on the content area, not based on // the entire surface, so that we scale in sync with windows that don't have insets. - mExtraHScale = (mTmpStackBounds.width() - hInsets) / (float)(surfaceWidth - hInsets); - mExtraVScale = (mTmpStackBounds.height() - vInsets) / (float)(surfaceHeight - vInsets); + mExtraHScale = mTmpStackBounds.width() / (float)(surfaceWidth - hInsets); + mExtraVScale = mTmpStackBounds.height() / (float)(surfaceHeight - vInsets); // In the case of ForceScaleToStack we scale entire tasks together, // and so we need to scale our offsets relative to the task bounds