diff options
| author | Shimi Zhang <ctzsm@google.com> | 2017-12-28 17:33:37 -0800 |
|---|---|---|
| committer | Shimi Zhang <ctzsm@google.com> | 2018-01-02 17:31:01 +0000 |
| commit | 29d1e9eed1a4bedfe883c2009afaa21f91e1f10f (patch) | |
| tree | 935605e73c5c72536fe1ee07cd9561d9a3d1c8fd /core/java/android/widget/Magnifier.java | |
| parent | 8b3a0d2a6e1c3b51f871f8622e853412a8d35cf4 (diff) | |
[Magnifier] Comparing the correct coordinates to in Magnifier update.
Previously we are comparing the clamped coordinates to avoid
unnecessary update of magnifier content. However if the magnifier is
reaching to the edge of the screen it doesn't update itself because
coordinates passed to Magnifier#show() later are clamped to the same.
This CL compares the coordinates without clamping to fix the issue.
Bug: 70580848
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Test: manual test with WebView that shows the magnifier works.
Change-Id: I65d681da334d5037a924e733d1a27cfd77231726
Diffstat (limited to 'core/java/android/widget/Magnifier.java')
| -rw-r--r-- | core/java/android/widget/Magnifier.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/java/android/widget/Magnifier.java b/core/java/android/widget/Magnifier.java index bd48f4554c5d..26dfcc2d668a 100644 --- a/core/java/android/widget/Magnifier.java +++ b/core/java/android/widget/Magnifier.java @@ -125,7 +125,7 @@ public final class Magnifier { mView.getWidth() - mBitmap.getWidth())); final int startY = mCenterZoomCoords.y - mBitmap.getHeight() / 2; - if (startX != mPrevStartCoordsInSurface.x || startY != mPrevStartCoordsInSurface.y) { + if (xPosInView != mPrevPosInView.x || yPosInView != mPrevPosInView.y) { performPixelCopy(startX, startY); mPrevPosInView.x = xPosInView; |
