Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2740)

Unified Diff: Source/web/WebViewImpl.cpp

Issue 268363013: Text selection handles now take into account pinch viewport's offset. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/web/tests/PinchViewportTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebViewImpl.cpp
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index a070e5041f681efab4e87a51916b0604875b92c4..cb85e0485d1e33ca8e3724e1e04e9627e6cdd41d 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -2263,6 +2263,14 @@ bool WebViewImpl::selectionBounds(WebRect& anchor, WebRect& focus) const
IntRect scaledAnchor(frame->view()->contentsToWindow(anchor));
IntRect scaledFocus(frame->view()->contentsToWindow(focus));
+
+ if (pinchVirtualViewportEnabled()) {
+ IntPoint pinchViewportOffset =
+ roundedIntPoint(page()->frameHost().pinchViewport().visibleRect().location());
+ scaledAnchor.moveBy(-pinchViewportOffset);
+ scaledFocus.moveBy(-pinchViewportOffset);
+ }
+
scaledAnchor.scale(pageScaleFactor());
scaledFocus.scale(pageScaleFactor());
anchor = scaledAnchor;
« no previous file with comments | « no previous file | Source/web/tests/PinchViewportTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698