From 70522f5f5fb44f2f4df7a08aa64263c619e299cb Mon Sep 17 00:00:00 2001 From: Cary Clark Date: Tue, 21 Jul 2009 16:42:59 -0400 Subject: adjust right edge of copy bounds if edge is not found Sometimes the right edge of the copy rectangle misses the right-most character to be copied. An earlier change over- compensated by moving the edge boundary by 2. Now, move the edge boundary by 1, and if that fails, try 2. --- WebKit/android/jni/WebViewCore.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp index 40dc56dc9..f1cb3fa73 100644 --- a/WebKit/android/jni/WebViewCore.cpp +++ b/WebKit/android/jni/WebViewCore.cpp @@ -1352,11 +1352,17 @@ WebCore::String WebViewCore::getSelection(SkRegion* selRgn) DBG_NAV_LOG("!node"); return result; } - WebCore::IntPoint endPt = WebCore::IntPoint(rect.fRight - 2, cy); + WebCore::IntPoint endPt = WebCore::IntPoint(rect.fRight - 1, cy); hitTestResult = m_mainFrame->eventHandler()->hitTestResultAtPoint(endPt, false); WebCore::Node* endNode = hitTestResult.innerNode(); if (!endNode) { - DBG_NAV_LOG("!endNode"); + DBG_NAV_LOG("!endNode (right-1)"); + endPt = WebCore::IntPoint(rect.fRight - 2, cy); + hitTestResult = m_mainFrame->eventHandler()->hitTestResultAtPoint(endPt, false); + endNode = hitTestResult.innerNode(); + } + if (!endNode) { + DBG_NAV_LOG("!endNode (right-2)"); return result; } int start = findTextBoxIndex(node, startPt); -- cgit v1.2.3