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

Unified Diff: ui/events/gesture_detection/mock_motion_event.cc

Issue 349463002: [Android] Map raw touch coordinates to global gesture locations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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/events/gesture_detection/mock_motion_event.cc
diff --git a/ui/events/gesture_detection/mock_motion_event.cc b/ui/events/gesture_detection/mock_motion_event.cc
index 14623afcef03a9b145839d87507700cc9a3fcbba..d6e0a91b5a1f9f39adff2eca69b8e41e417f67a0 100644
--- a/ui/events/gesture_detection/mock_motion_event.cc
+++ b/ui/events/gesture_detection/mock_motion_event.cc
@@ -101,11 +101,11 @@ float MockMotionEvent::GetY(size_t pointer_index) const {
}
float MockMotionEvent::GetRawX(size_t pointer_index) const {
- return GetX(pointer_index);
+ return GetX(pointer_index) + raw_offset.x();
}
float MockMotionEvent::GetRawY(size_t pointer_index) const {
- return GetY(pointer_index);
+ return GetY(pointer_index) + raw_offset.y();
}
float MockMotionEvent::GetTouchMajor(size_t pointer_index) const {
@@ -196,4 +196,9 @@ void MockMotionEvent::SetTouchMajor(float new_touch_major) {
touch_major = new_touch_major;
}
+void MockMotionEvent::SetRawOffset(float raw_offset_x, float raw_offset_y) {
+ raw_offset.set_x(raw_offset_x);
+ raw_offset.set_y(raw_offset_y);
+}
+
} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698