summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Filip Gruszczynski <gruszczy@google.com> 2015-08-13 13:35:25 -0700
committer Filip Gruszczynski <gruszczy@google.com> 2015-08-13 13:36:52 -0700
commit9ca40b7a0ff79cc29d9875d313d1dc2731ccea5c (patch)
tree010edd91ff0548166f92d8248822d2a9297622f4
parent35b5fe25cf578c2fd63d5b3166f27de69a582189 (diff)
Apply window position translation after app transforms.
If this translation is applied prematurely and the app transform includes scaling, this translation will be affected and as a result it will move the window. Change-Id: Iaf7d104708f0775384495e42dbd82cb9ae03b8f7
-rw-r--r--services/core/java/com/android/server/wm/WindowStateAnimator.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/wm/WindowStateAnimator.java b/services/core/java/com/android/server/wm/WindowStateAnimator.java
index 48f2a9d767ee..5d33cbd23e3d 100644
--- a/services/core/java/com/android/server/wm/WindowStateAnimator.java
+++ b/services/core/java/com/android/server/wm/WindowStateAnimator.java
@@ -1090,7 +1090,6 @@ class WindowStateAnimator {
if (selfTransformation) {
tmpMatrix.postConcat(mTransformation.getMatrix());
}
- tmpMatrix.postTranslate(frame.left + mWin.mXOffset, frame.top + mWin.mYOffset);
if (attachedTransformation != null) {
tmpMatrix.postConcat(attachedTransformation.getMatrix());
}
@@ -1100,6 +1099,10 @@ class WindowStateAnimator {
if (screenAnimation) {
tmpMatrix.postConcat(screenRotationAnimation.getEnterTransformation().getMatrix());
}
+ // The translation that applies the position of the window needs to be applied at the
+ // end in case that other translations include scaling. Otherwise the scaling will
+ // affect this translation.
+ tmpMatrix.postTranslate(frame.left + mWin.mXOffset, frame.top + mWin.mYOffset);
//TODO (multidisplay): Magnification is supported only for the default display.
if (mService.mAccessibilityController != null && displayId == Display.DEFAULT_DISPLAY) {