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

Unified Diff: content/renderer/input/input_handler_proxy.cc

Issue 602873002: Prevent orthogonal fling accumulation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More cleanup Created 6 years, 3 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: content/renderer/input/input_handler_proxy.cc
diff --git a/content/renderer/input/input_handler_proxy.cc b/content/renderer/input/input_handler_proxy.cc
index 90df5cb70e82c70706586ec3e8b07a9baec07abf..d9a34ada63b15efc548b0188ee606161997a3bfb 100644
--- a/content/renderer/input/input_handler_proxy.cc
+++ b/content/renderer/input/input_handler_proxy.cc
@@ -70,7 +70,7 @@ bool ShouldSuppressScrollForFlingBoosting(
gfx::Vector2dF dx(scroll_update_event.data.scrollUpdate.deltaX,
scroll_update_event.data.scrollUpdate.deltaY);
- if (gfx::DotProduct(current_fling_velocity, dx) < 0)
+ if (gfx::DotProduct(current_fling_velocity, dx) <= 0)
return false;
if (time_since_last_boost_event < 0.001)
@@ -94,7 +94,7 @@ bool ShouldBoostFling(const gfx::Vector2dF& current_fling_velocity,
fling_start_event.data.flingStart.velocityX,
fling_start_event.data.flingStart.velocityY);
- if (gfx::DotProduct(current_fling_velocity, new_fling_velocity) < 0)
+ if (gfx::DotProduct(current_fling_velocity, new_fling_velocity) <= 0)
return false;
if (current_fling_velocity.LengthSquared() < kMinBoostFlingSpeedSquare)
@@ -550,6 +550,8 @@ bool InputHandlerProxy::FilterInputEventForFlingBoosting(
WebFloatPoint velocity(current_fling_velocity_.x(),
current_fling_velocity_.y());
deferred_fling_cancel_time_seconds_ = 0;
+ disallow_horizontal_fling_scroll_ = !velocity.x;
+ disallow_vertical_fling_scroll_ = !velocity.y;
last_fling_boost_event_ = WebGestureEvent();
fling_curve_.reset(client_->CreateFlingAnimationCurve(
gesture_event.sourceDevice,

Powered by Google App Engine
This is Rietveld 408576698