Scale task view in TaskViewSimulator before translating it

The pivot is supposed to be at the center of the task view, hence why
we use width / 2, height / 2, but technically this is assuming that
translation == 0. This error isn't normally noticeable because scale
is 1 when the task is centered, so the pivot doesn't matter. By
scaling before translating, we ensure the pivot doesn't depend on
the translation.

Test: scroll side to side while swiping up from an app, ensure the
running window scales down properly; when you let go to enter recents
while the second task is centermost, the running window ends in the
exact position as the first TaskView that replaces it.

Fixes: 169103357
Change-Id: Ica53c6b6fb073304c29f26d30fb829bb9d282185
diff --git a/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java b/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java
index 903e87a..081413e 100644
--- a/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java
+++ b/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java
@@ -297,9 +297,9 @@
         mMatrix.postTranslate(insets.left, insets.top);
         mMatrix.postScale(scale, scale);
 
-        // Apply TaskView matrix: translate, scale, scroll
-        mMatrix.postTranslate(mTaskRect.left, mTaskRect.top + mOffsetY);
+        // Apply TaskView matrix: scale, translate, scroll
         mMatrix.postScale(mCurveScale, mCurveScale, taskWidth / 2, taskHeight / 2);
+        mMatrix.postTranslate(mTaskRect.left, mTaskRect.top + mOffsetY);
         mOrientationState.getOrientationHandler().set(
                 mMatrix, MATRIX_POST_TRANSLATE, mScrollState.scroll);