diff options
-rw-r--r-- | WebCore/platform/graphics/android/LayerAndroid.cpp | 8 | ||||
-rw-r--r-- | WebCore/platform/graphics/android/LayerAndroid.h | 4 | ||||
-rw-r--r-- | WebKit/android/nav/SelectText.cpp | 8 |
3 files changed, 12 insertions, 8 deletions
diff --git a/WebCore/platform/graphics/android/LayerAndroid.cpp b/WebCore/platform/graphics/android/LayerAndroid.cpp index e37b083..f443004 100644 --- a/WebCore/platform/graphics/android/LayerAndroid.cpp +++ b/WebCore/platform/graphics/android/LayerAndroid.cpp @@ -292,11 +292,11 @@ public: } }; -class LayerAndroidFindState { +class LayerAndroid::FindState { public: static const int TOUCH_SLOP = 10; - LayerAndroidFindState(int x, int y) + FindState(int x, int y) : m_x(x) , m_y(y) , m_best(0) @@ -332,7 +332,7 @@ protected: FindCanvas m_checker; }; -void LayerAndroid::findInner(LayerAndroidFindState& state) const +void LayerAndroid::findInner(LayerAndroid::FindState& state) const { int x = state.x(); int y = state.y(); @@ -353,7 +353,7 @@ void LayerAndroid::findInner(LayerAndroidFindState& state) const const LayerAndroid* LayerAndroid::find(int x, int y, SkPicture* root) const { - LayerAndroidFindState state(x, y); + FindState state(x, y); SkRect rootBounds; rootBounds.setEmpty(); if (root && state.drew(root, rootBounds) && state.drewText()) diff --git a/WebCore/platform/graphics/android/LayerAndroid.h b/WebCore/platform/graphics/android/LayerAndroid.h index fb6d78c..939c95c 100644 --- a/WebCore/platform/graphics/android/LayerAndroid.h +++ b/WebCore/platform/graphics/android/LayerAndroid.h @@ -72,7 +72,6 @@ struct SkLength { namespace WebCore { class AndroidAnimation; -class LayerAndroidFindState; class LayerAndroid : public SkLayer { @@ -201,11 +200,12 @@ protected: virtual void onDraw(SkCanvas*, SkScalar opacity); private: + class FindState; #if DUMP_NAV_CACHE friend class CachedLayer::Debug; // debugging access only #endif - void findInner(LayerAndroidFindState& ) const; + void findInner(FindState& ) const; bool prepareContext(bool force = false); void clipInner(SkTDArray<SkRect>* region, const SkRect& local) const; diff --git a/WebKit/android/nav/SelectText.cpp b/WebKit/android/nav/SelectText.cpp index 2a1ca34..352ec7e 100644 --- a/WebKit/android/nav/SelectText.cpp +++ b/WebKit/android/nav/SelectText.cpp @@ -1379,6 +1379,8 @@ void SelectText::extendSelection(const IntRect& vis, int x, int y) setVisibleRect(vis); SkIRect clipRect = m_visibleRect; int base; + DBG_NAV_LOGD("extend x/y=%d,%d m_startOffset=%d,%d", x, y, + m_startOffset.fX, m_startOffset.fY); x -= m_startOffset.fX; y -= m_startOffset.fY; if (m_startSelection) { @@ -1397,6 +1399,8 @@ void SelectText::extendSelection(const IntRect& vis, int x, int y) m_extendSelection = true; m_original.fX = m_original.fY = 0; } + DBG_NAV_LOGD("extend x/y=%d,%d m_original=%d,%d", x, y, + m_original.fX, m_original.fY); x -= m_original.fX; y -= m_original.fY; if (!clipRect.contains(x, y) || !clipRect.contains(m_selStart)) { @@ -1588,11 +1592,11 @@ bool SelectText::startSelection(const CachedRoot* root, const IntRect& vis, m_picture->width(), m_picture->height(),left, top, right, bottom, x, y); if (m_hitTopLeft && (!hitBottomRight || y - top < bottom - y)) { DBG_NAV_LOG("hit top left"); - m_original.fX -= left; + m_original.fX -= m_selStart.fLeft; m_original.fY -= (m_selStart.fTop + m_selStart.fBottom) >> 1; } else if (hitBottomRight) { DBG_NAV_LOG("hit bottom right"); - m_original.fX -= right; + m_original.fX -= m_selEnd.fRight; m_original.fY -= (m_selEnd.fTop + m_selEnd.fBottom) >> 1; } return m_hitTopLeft || hitBottomRight; |