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

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

Issue 2860793003: Pass through tilt_x and tilt_y to blink (Closed)
Patch Set: Pass through tilt_x and tilt_y to blink Created 3 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/events/gesture_detection/motion_event_generic.h ('k') | ui/events/gestures/motion_event_aura.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/gesture_detection/motion_event_generic.cc
diff --git a/ui/events/gesture_detection/motion_event_generic.cc b/ui/events/gesture_detection/motion_event_generic.cc
index 951a4d18ff77b61e52cec684adcf7917bcc1411e..ad4d7286d3605d2bc2743a6333b3557d48117d8b 100644
--- a/ui/events/gesture_detection/motion_event_generic.cc
+++ b/ui/events/gesture_detection/motion_event_generic.cc
@@ -31,9 +31,9 @@ PointerProperties::PointerProperties(float x, float y, float touch_major)
touch_major(touch_major),
touch_minor(0),
orientation(0),
- tilt(0),
- source_device_id(0) {
-}
+ tilt_x(0),
+ tilt_y(0),
+ source_device_id(0) {}
PointerProperties::PointerProperties(const MotionEvent& event,
size_t pointer_index)
@@ -47,9 +47,9 @@ PointerProperties::PointerProperties(const MotionEvent& event,
touch_major(event.GetTouchMajor(pointer_index)),
touch_minor(event.GetTouchMinor(pointer_index)),
orientation(event.GetOrientation(pointer_index)),
- tilt(event.GetTilt(pointer_index)),
- source_device_id(0) {
-}
+ tilt_x(event.GetTiltX(pointer_index)),
+ tilt_y(event.GetTiltY(pointer_index)),
+ source_device_id(0) {}
PointerProperties::PointerProperties(const PointerProperties& other) = default;
@@ -176,9 +176,14 @@ float MotionEventGeneric::GetPressure(size_t pointer_index) const {
return pointers_[pointer_index].pressure;
}
-float MotionEventGeneric::GetTilt(size_t pointer_index) const {
+float MotionEventGeneric::GetTiltX(size_t pointer_index) const {
+ DCHECK_LT(pointer_index, pointers_->size());
+ return pointers_[pointer_index].tilt_x;
+}
+
+float MotionEventGeneric::GetTiltY(size_t pointer_index) const {
DCHECK_LT(pointer_index, pointers_->size());
- return pointers_[pointer_index].tilt;
+ return pointers_[pointer_index].tilt_y;
}
MotionEvent::ToolType MotionEventGeneric::GetToolType(
« no previous file with comments | « ui/events/gesture_detection/motion_event_generic.h ('k') | ui/events/gestures/motion_event_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698