Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6d2b3ac6 authored by Seigo Nonaka's avatar Seigo Nonaka Committed by Android (Google) Code Review
Browse files

Merge "Show selection handles at the correct position for view transformation" into nyc-dev

parents 9ad5278e 2f229ca2
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -18916,7 +18916,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
        transformFromViewToWindowSpace(outLocation);
    }
    void transformFromViewToWindowSpace(@Size(2) int[] inOutLocation) {
    /** @hide */
    public void transformFromViewToWindowSpace(@Size(2) int[] inOutLocation) {
        if (inOutLocation == null || inOutLocation.length < 2) {
            throw new IllegalArgumentException("inOutLocation must be an array of two integers");
        }
+7 −5
Original line number Diff line number Diff line
@@ -4131,13 +4131,15 @@ public class Editor {
                }

                if (isVisible()) {
                    final int positionX = parentPositionX + mPositionX;
                    final int positionY = parentPositionY + mPositionY;
                    // Transform to the window coordinates to follow the view tranformation.
                    final int[] pts = { mPositionX + mHotspotX + getHorizontalOffset(), mPositionY};
                    mTextView.transformFromViewToWindowSpace(pts);
                    pts[0] -= mHotspotX + getHorizontalOffset();

                    if (isShowing()) {
                        mContainer.update(positionX, positionY, -1, -1);
                        mContainer.update(pts[0], pts[1], -1, -1);
                    } else {
                        mContainer.showAtLocation(mTextView, Gravity.NO_GRAVITY,
                                positionX, positionY);
                        mContainer.showAtLocation(mTextView, Gravity.NO_GRAVITY, pts[0], pts[1]);
                    }
                } else {
                    if (isShowing()) {