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

Unified Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 2605193002: Fix mouse wheel over-scrolls when display is scaled and scroll is paginated (Closed)
Patch Set: Created 3 years, 11 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
Index: third_party/WebKit/Source/web/WebViewImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp
index ec409dccc405fedd2d81baa707bbf09318ad3e77..5796922ba24486a10b47f325857a4bf2593342cc 100644
--- a/third_party/WebKit/Source/web/WebViewImpl.cpp
+++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -749,6 +749,13 @@ WebInputEventResult WebViewImpl::handleGestureEvent(
WebGestureEvent scaledEvent =
TransformWebGestureEvent(mainFrameImpl()->frameView(), event);
+ if (event.sourceDevice == WebGestureDeviceTouchpad &&
+ event.type == WebInputEvent::GestureScrollUpdate) {
+ float scaleFactor = client()->GetOriginalDeviceScaleFactor();
chengx 2017/01/06 23:46:36 aelias 2017/01/05 00:55:45 CC impl thread also has
+ scaledEvent.data.scrollUpdate.deltaX /= scaleFactor;
+ scaledEvent.data.scrollUpdate.deltaY /= scaleFactor;
chengx 2017/01/06 23:46:36 Bret: Use client()->convertViewportToWindow() inst
+ }
+
// Special handling for double tap and scroll events as we don't want to
// hit test for them.
switch (event.type) {

Powered by Google App Engine
This is Rietveld 408576698