The x and y position of the pop-up where not calculated correctly when the text view had internal scrolling.

This method is invoked only when the pop-up is currently displayed and the text scrolles.

This is scenario is reproducible only with Voice IME (I think), as the text is inserted without
touching the screen.

Bug: 5290463

Change-Id: I0b842732cc1f115de06e992fbe28cb64eac49b22
This commit is contained in:
Luca Zanolin
2011-09-28 11:43:22 +01:00
parent 9f48d6348d
commit a403cb7e72

View File

@ -9433,8 +9433,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
return false;
}
int posX = mPositionX + positionX;
int posY = mPositionY + positionY;
int posX = mPositionX + positionX - getScrollX();
int posY = mPositionY + positionY - getScrollY();
// Offset by 1 to take into account 0.5 and int rounding around getPrimaryHorizontal.
return posX >= clip.left - 1 && posX <= clip.right + 1 &&