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

Commit 47eddecc authored by Robert Carr's avatar Robert Carr
Browse files

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
parent 7f7b8479
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -1328,8 +1328,8 @@ class WindowStateAnimator {
            task.mStack.getDimBounds(mTmpStackBounds);
            task.mStack.getDimBounds(mTmpStackBounds);
            // We want to calculate the scaling based on the content area, not based on
            // 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.
            // the entire surface, so that we scale in sync with windows that don't have insets.
            mExtraHScale = (mTmpStackBounds.width() - hInsets) / (float)(surfaceWidth - hInsets);
            mExtraHScale = mTmpStackBounds.width() / (float)(surfaceWidth - hInsets);
            mExtraVScale = (mTmpStackBounds.height() - vInsets) / (float)(surfaceHeight - vInsets);
            mExtraVScale = mTmpStackBounds.height() / (float)(surfaceHeight - vInsets);


            // In the case of ForceScaleToStack we scale entire tasks together,
            // In the case of ForceScaleToStack we scale entire tasks together,
            // and so we need to scale our offsets relative to the task bounds
            // and so we need to scale our offsets relative to the task bounds