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

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

Issue 822803005: Correct missing radius in ui::TouchEvent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DCHECK touch minor <= touch major Created 5 years, 11 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 | « no previous file | content/browser/renderer_host/input/web_input_event_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/input/web_input_event_util.cc
diff --git a/content/browser/renderer_host/input/web_input_event_util.cc b/content/browser/renderer_host/input/web_input_event_util.cc
index bfba064bdf6889c5778526f601429c194affc65e..14ecfd6ac6aad1b84bbfdb9d396f1fd5378086dd 100644
--- a/content/browser/renderer_host/input/web_input_event_util.cc
+++ b/content/browser/renderer_host/input/web_input_event_util.cc
@@ -210,6 +210,11 @@ WebTouchPoint CreateWebTouchPoint(const MotionEvent& event,
float major_radius = event.GetTouchMajor(pointer_index) / 2.f;
float minor_radius = event.GetTouchMinor(pointer_index) / 2.f;
+
+ DCHECK(minor_radius <= major_radius);
jdduke (slow) 2015/01/13 19:31:26 Nit: DCHECK_LE
+ if (minor_radius == 0)
+ minor_radius = major_radius;
+
float orientation_deg = event.GetOrientation(pointer_index) * 180.f / M_PI;
DCHECK_GE(major_radius, 0);
DCHECK_GE(minor_radius, 0);
« no previous file with comments | « no previous file | content/browser/renderer_host/input/web_input_event_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698