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

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

Issue 22354005: Add support for maintaining ordinal values through GestureRecognizer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix to fling Created 7 years, 4 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: ui/base/gestures/gesture_sequence.cc
diff --git a/ui/base/gestures/gesture_sequence.cc b/ui/base/gestures/gesture_sequence.cc
index 1c674087a6a3df307df8cb9dadf0b69ae67223bc..b4f32e4b50daac1538945c50e4233719b413e542 100644
--- a/ui/base/gestures/gesture_sequence.cc
+++ b/ui/base/gestures/gesture_sequence.cc
@@ -746,7 +746,9 @@ void GestureSequence::AppendScrollGestureEnd(const GesturePoint& point,
gestures->push_back(CreateGestureEvent(
GestureEventDetails(ui::ET_SCROLL_FLING_START,
CalibrateFlingVelocity(railed_x_velocity),
- CalibrateFlingVelocity(railed_y_velocity)),
+ CalibrateFlingVelocity(railed_y_velocity),
+ CalibrateFlingVelocity(x_velocity),
+ CalibrateFlingVelocity(y_velocity)),
location,
flags_,
base::Time::FromDoubleT(point.last_touch_time()),
@@ -789,6 +791,8 @@ void GestureSequence::AppendScrollGestureUpdate(GesturePoint& point,
last_scroll_prediction_offset_.y());
}
+ gfx::Vector2dF o = d;
+
if (scroll_type_ == ST_HORIZONTAL)
d.set_y(0);
else if (scroll_type_ == ST_VERTICAL)
@@ -796,10 +800,13 @@ void GestureSequence::AppendScrollGestureUpdate(GesturePoint& point,
if (d.IsZero())
return;
- GestureEventDetails details(ui::ET_GESTURE_SCROLL_UPDATE, d.x(), d.y());
+ GestureEventDetails details(ui::ET_GESTURE_SCROLL_UPDATE,
+ d.x(), d.y(), o.x(), o.y());
details.SetScrollVelocity(
scroll_type_ == ST_VERTICAL ? 0 : point.XVelocity(),
- scroll_type_ == ST_HORIZONTAL ? 0 : point.YVelocity());
+ scroll_type_ == ST_HORIZONTAL ? 0 : point.YVelocity(),
+ point.XVelocity(),
+ point.YVelocity());
gestures->push_back(CreateGestureEvent(
details,
location,

Powered by Google App Engine
This is Rietveld 408576698