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

Unified Diff: ui/base/gestures/gesture_sequence.cc

Issue 10446103: GestureScrollEnd event had non-zero velocity causing overscroll on software fling path. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed unit tests Created 8 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 | « ui/aura/gestures/gesture_recognizer_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/gestures/gesture_sequence.cc
diff --git a/ui/base/gestures/gesture_sequence.cc b/ui/base/gestures/gesture_sequence.cc
index 5e74aff3b7a10912ffc9c7e1fb995de341fc9ace..c0441feb0ecd2d08289093c3fa951d17fd623c0f 100644
--- a/ui/base/gestures/gesture_sequence.cc
+++ b/ui/base/gestures/gesture_sequence.cc
@@ -482,25 +482,29 @@ void GestureSequence::AppendScrollGestureEnd(const GesturePoint& point,
else if (scroll_type_ == ST_VERTICAL)
railed_x_velocity = 0;
+ // TODO(rjkroege): It is conceivable that we could suppress sending the
+ // GestureScrollEnd if it is immediately followed by a GestureFlingStart.
gestures->push_back(helper_->CreateGestureEvent(
ui::ET_GESTURE_SCROLL_END,
location,
flags_,
base::Time::FromDoubleT(point.last_touch_time()),
- railed_x_velocity, railed_y_velocity, 1 << point.touch_id()));
+ 0., 0., 1 << point.touch_id()));
if (railed_x_velocity != 0 || railed_y_velocity != 0) {
// TODO(sad|rjkroege): fling-curve is currently configured to work well with
// touchpad scroll-events. This curve needs to be adjusted to work correctly
- // with both touchpad and touchscreen. Until then, multiply the velocity for
- // touchscreen with a constant.
+ // with both touchpad and touchscreen. Until then, scale quadratically.
// http://crbug.com/120154
+ const float velocity_scaling = 1.f / 900.f;
+
gestures->push_back(helper_->CreateGestureEvent(
ui::ET_SCROLL_FLING_START,
location,
flags_,
base::Time::FromDoubleT(point.last_touch_time()),
- railed_x_velocity * 2.5, railed_y_velocity * 2.5,
+ velocity_scaling * railed_x_velocity * fabsf(railed_x_velocity),
+ velocity_scaling * railed_y_velocity * fabsf(railed_y_velocity),
1 << point.touch_id()));
}
}
« no previous file with comments | « ui/aura/gestures/gesture_recognizer_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698