diff options
author | George Mount <mount@google.com> | 2012-03-21 12:15:02 -0700 |
---|---|---|
committer | George Mount <mount@google.com> | 2012-03-21 14:11:24 -0700 |
commit | e5d643b22badb45c77ef040896bd8ac46edae7d0 (patch) | |
tree | 08d1f58be3b5d73c0d82b614ca83c74c55ae6fb6 /Source/WebKit/android/nav | |
parent | 26496e790276f8dfe693d2b011c8b34c643317cb (diff) | |
download | external_webkit-e5d643b22badb45c77ef040896bd8ac46edae7d0.zip external_webkit-e5d643b22badb45c77ef040896bd8ac46edae7d0.tar.gz external_webkit-e5d643b22badb45c77ef040896bd8ac46edae7d0.tar.bz2 |
Fix location of selection handles on rotated text.
Bug 6206177
The left/bottom of the caret is always the point at which the
selection should point. The top/right is at the "top" of the text.
Change-Id: Ie13f6ad5bfea3614892c0f986e019393f77ab3cf
Diffstat (limited to 'Source/WebKit/android/nav')
-rw-r--r-- | Source/WebKit/android/nav/WebView.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/Source/WebKit/android/nav/WebView.cpp b/Source/WebKit/android/nav/WebView.cpp index b475c5f..7d1ff75 100644 --- a/Source/WebKit/android/nav/WebView.cpp +++ b/Source/WebKit/android/nav/WebView.cpp @@ -617,7 +617,25 @@ int getHandleLayerId(SelectText::HandleId handleId, SkIRect& cursorRect) { return -1; int layerId = selectText->caretLayerId(handleId); cursorRect = selectText->caretRect(handleId); - mapLayerRect(layerId, cursorRect); + if (layerId != -1) { + // We need to make sure the drawTransform is up to date as this is + // called before a draw() or drawGL() + m_baseLayer->updateLayerPositions(m_visibleRect); + LayerAndroid* root = compositeRoot(); + LayerAndroid* layer = root ? root->findById(layerId) : 0; + if (layer && layer->drawTransform()) { + const TransformationMatrix* transform = layer->drawTransform(); + // We're overloading the concept of Rect to be just the two + // points (bottom-left and top-right. + // TODO: Use FloatQuad instead. + IntPoint bottomLeft = transform->mapPoint(IntPoint(cursorRect.fLeft, + cursorRect.fBottom)); + IntPoint topRight = transform->mapPoint(IntPoint(cursorRect.fRight, + cursorRect.fTop)); + cursorRect.setLTRB(bottomLeft.x(), topRight.y(), topRight.x(), + bottomLeft.y()); + } + } return layerId; } |