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

Unified Diff: ui/base/gestures/gesture_types.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
« no previous file with comments | « ui/base/gestures/gesture_types.h ('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_types.cc
diff --git a/ui/base/gestures/gesture_types.cc b/ui/base/gestures/gesture_types.cc
index b8217af85d552ed8c9edec50afa80ba1d674b47c..e8bb3ef6a994bdc1c54f542425564819797fbaae 100644
--- a/ui/base/gestures/gesture_types.cc
+++ b/ui/base/gestures/gesture_types.cc
@@ -15,11 +15,15 @@ GestureEventDetails::GestureEventDetails(ui::EventType type,
case ui::ET_GESTURE_SCROLL_UPDATE:
data.scroll_update.x = delta_x;
data.scroll_update.y = delta_y;
+ data.scroll_update.x_ordinal = delta_x;
+ data.scroll_update.y_ordinal = delta_y;
break;
case ui::ET_SCROLL_FLING_START:
data.fling_velocity.x = delta_x;
data.fling_velocity.y = delta_y;
+ data.scroll_update.x_ordinal = delta_x;
rjkroege 2013/08/09 22:18:43 should be fling_velocity?
DaveMoore 2013/08/12 20:38:16 Done.
+ data.scroll_update.y_ordinal = delta_y;
break;
case ui::ET_GESTURE_LONG_PRESS:
@@ -58,11 +62,44 @@ GestureEventDetails::GestureEventDetails(ui::EventType type,
}
}
+GestureEventDetails::GestureEventDetails(ui::EventType type,
+ float delta_x,
+ float delta_y,
+ float delta_x_ordinal,
+ float delta_y_ordinal)
+ : type_(type),
+ touch_points_(1) {
+ CHECK(type == ui::ET_GESTURE_SCROLL_UPDATE ||
+ type == ui::ET_SCROLL_FLING_START);
+ switch (type_) {
+ case ui::ET_GESTURE_SCROLL_UPDATE:
+ data.scroll_update.x = delta_x;
+ data.scroll_update.y = delta_y;
+ data.scroll_update.x_ordinal = delta_x_ordinal;
+ data.scroll_update.y_ordinal = delta_y_ordinal;
+ break;
+
+ case ui::ET_SCROLL_FLING_START:
+ data.fling_velocity.x = delta_x;
+ data.fling_velocity.y = delta_y;
+ data.scroll_update.x_ordinal = delta_x_ordinal;
rjkroege 2013/08/09 22:18:43 should be fling_velocity here and line below?
DaveMoore 2013/08/12 20:38:16 Done.
+ data.scroll_update.y_ordinal = delta_y_ordinal;
+ break;
+
+ default:
+ break;
+ }
+}
+
void GestureEventDetails::SetScrollVelocity(float velocity_x,
- float velocity_y) {
+ float velocity_y,
+ float velocity_x_ordinal,
+ float velocity_y_ordinal) {
CHECK_EQ(ui::ET_GESTURE_SCROLL_UPDATE, type_);
data.scroll_update.velocity_x = velocity_x;
data.scroll_update.velocity_y = velocity_y;
+ data.scroll_update.velocity_x_ordinal = velocity_x_ordinal;
+ data.scroll_update.velocity_y_ordinal = velocity_y_ordinal;
}
} // namespace ui
« no previous file with comments | « ui/base/gestures/gesture_types.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698