Fixing jump when swiping up/down in landspace rotation

FullscreenDrawParams.scale is caculated relative to TaskView matrix, but drawnInsets is
based on Thumbnail matix calculation, so the scale should be applied first, such that
dranInsets and other TaskView translations have the same base matrix

Bug: 157626483
Bug: 156268804
Change-Id: Id33c7db9a71dd001a41c66ddf07834791d0bd382
This commit is contained in:
Sunny Goyal
2020-06-03 11:33:58 -07:00
parent 11cb2e469b
commit 1d756513ea
2 changed files with 3 additions and 3 deletions
@@ -258,9 +258,9 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy {
mMatrix.postScale(scale, scale);
mMatrix.postTranslate(insets.left, insets.top);
// Apply TaskView matrix: scale, translate, scroll
mMatrix.postScale(mCurveScale, mCurveScale, taskWidth / 2, taskHeight / 2);
// Apply TaskView matrix: translate, scale, scroll
mMatrix.postTranslate(mTaskRect.left, mTaskRect.top);
mMatrix.postScale(mCurveScale, mCurveScale, taskWidth / 2, taskHeight / 2);
mOrientationState.getOrientationHandler().set(
mMatrix, MATRIX_POST_TRANSLATE, mScrollState.scroll);
@@ -227,8 +227,8 @@ public class TaskThumbnailView extends View implements PluginListener<OverviewSc
protected void onDraw(Canvas canvas) {
RectF currentDrawnInsets = mFullscreenParams.mCurrentDrawnInsets;
canvas.save();
canvas.translate(currentDrawnInsets.left, currentDrawnInsets.top);
canvas.scale(mFullscreenParams.mScale, mFullscreenParams.mScale);
canvas.translate(currentDrawnInsets.left, currentDrawnInsets.top);
// Draw the insets if we're being drawn fullscreen (we do this for quick switch).
drawOnCanvas(canvas,
-currentDrawnInsets.left,