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

Commit 808e8f68 authored by Cary Clark's avatar Cary Clark Committed by Android (Google) Code Review
Browse files

Merge "center long press to account for sloppy nodes"

parents 261f33c1 3ecd7db5
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -2272,6 +2272,17 @@ public class WebView extends AbsoluteLayout
        }
        int contentX = viewToContentX(mLastTouchX + mScrollX);
        int contentY = viewToContentY(mLastTouchY + mScrollY);
        if (nativeHasCursorNode()) {
            Rect cursorBounds = nativeGetCursorRingBounds();
            if (!cursorBounds.contains(contentX, contentY)) {
                int slop = viewToContentDimension(mNavSlop);
                cursorBounds.inset(-slop, -slop);
                if (cursorBounds.contains(contentX, contentY)) {
                    contentX = (int) cursorBounds.centerX();
                    contentY = (int) cursorBounds.centerY();
                }
            }
        }
        mWebViewCore.sendMessage(EventHub.REQUEST_CURSOR_HREF,
                contentX, contentY, hrefMsg);
    }