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

Unified Diff: content/browser/renderer_host/input/motion_event_web.cc

Issue 1218663006: Use new WebTouchPoint field names. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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: content/browser/renderer_host/input/motion_event_web.cc
diff --git a/content/browser/renderer_host/input/motion_event_web.cc b/content/browser/renderer_host/input/motion_event_web.cc
index bc47cf8c17734a662dc43ad10a8662340fbed16f..7ec0623a72c0967c11d6c8d9e2aef8b135a9b3e1 100644
--- a/content/browser/renderer_host/input/motion_event_web.cc
+++ b/content/browser/renderer_host/input/motion_event_web.cc
@@ -91,7 +91,7 @@ size_t MotionEventWeb::GetPointerCount() const { return event_.touchesLength; }
int MotionEventWeb::GetPointerId(size_t pointer_index) const {
DCHECK_LT(pointer_index, GetPointerCount());
- return event_.touches[pointer_index].id;
+ return event_.touches[pointer_index].pointerId;
}
float MotionEventWeb::GetX(size_t pointer_index) const {
@@ -116,14 +116,14 @@ float MotionEventWeb::GetRawY(size_t pointer_index) const {
float MotionEventWeb::GetTouchMajor(size_t pointer_index) const {
DCHECK_LT(pointer_index, GetPointerCount());
- return 2.f * std::max(event_.touches[pointer_index].radiusX,
- event_.touches[pointer_index].radiusY);
+ return 2.f * std::max(event_.touches[pointer_index].width,
+ event_.touches[pointer_index].height);
}
float MotionEventWeb::GetTouchMinor(size_t pointer_index) const {
DCHECK_LT(pointer_index, GetPointerCount());
- return 2.f * std::min(event_.touches[pointer_index].radiusX,
- event_.touches[pointer_index].radiusY);
+ return 2.f * std::min(event_.touches[pointer_index].width,
+ event_.touches[pointer_index].height);
}
float MotionEventWeb::GetOrientation(size_t pointer_index) const {
@@ -134,9 +134,9 @@ float MotionEventWeb::GetOrientation(size_t pointer_index) const {
DCHECK(0 <= rotation_angle_rad && rotation_angle_rad <= M_PI_2)
<< "Unexpected touch rotation angle";
- if (event_.touches[pointer_index].radiusX
- > event_.touches[pointer_index].radiusY) {
- // The case radiusX == radiusY is omitted from here on purpose: for circles,
+ if (event_.touches[pointer_index].width >
+ event_.touches[pointer_index].height) {
+ // The case width == height is omitted from here on purpose: for circles,
// we want to pass the angle (which could be any value in such cases but
// always seem to be set to zero) unchanged.
rotation_angle_rad -= (float) M_PI_2;

Powered by Google App Engine
This is Rietveld 408576698