summaryrefslogtreecommitdiffstats
path: root/Source/WebKit/android/nav/SelectText.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit/android/nav/SelectText.cpp')
-rw-r--r--Source/WebKit/android/nav/SelectText.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/Source/WebKit/android/nav/SelectText.cpp b/Source/WebKit/android/nav/SelectText.cpp
index 8427e6f..98ec574 100644
--- a/Source/WebKit/android/nav/SelectText.cpp
+++ b/Source/WebKit/android/nav/SelectText.cpp
@@ -1478,7 +1478,8 @@ static void addEnd(SkRegion* diff, const SkIRect& rect)
diff->op(bounds, SkRegion::kUnion_Op);
}
-void SelectText::getSelectionRegion(const IntRect& vis, SkRegion *region)
+void SelectText::getSelectionRegion(const IntRect& vis, SkRegion *region,
+ LayerAndroid* root)
{
SkIRect ivisBounds = vis;
ivisBounds.join(m_selStart);
@@ -1486,6 +1487,14 @@ void SelectText::getSelectionRegion(const IntRect& vis, SkRegion *region)
region->setEmpty();
buildSelection(*m_picture, ivisBounds, m_selStart, m_startBase,
m_selEnd, m_endBase, region);
+ if (root && m_layerId) {
+ Layer* layer = root->findById(m_layerId);
+ while (layer) {
+ const SkPoint& pos = layer->getPosition();
+ region->translate(pos.fX, pos.fY);
+ layer = layer->getParent();
+ }
+ }
}
void SelectText::drawSelectionRegion(SkCanvas* canvas, IntRect* inval)