diff options
author | Cary Clark <cary@android.com> | 2009-07-21 16:42:59 -0400 |
---|---|---|
committer | Cary Clark <cary@android.com> | 2009-07-21 16:42:59 -0400 |
commit | 70522f5f5fb44f2f4df7a08aa64263c619e299cb (patch) | |
tree | 843aad38e9d14fab883e858e55a797607362d64d | |
parent | fbb3cf06215bcef4e6f43d2b15d6c92b66c75a13 (diff) | |
download | webkit-70522f5f5fb44f2f4df7a08aa64263c619e299cb.tar.gz |
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.
-rw-r--r-- | WebKit/android/jni/WebViewCore.cpp | 10 |
1 files 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); |