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

Unified Diff: ui/events/event.h

Issue 822803005: Correct missing radius in ui::TouchEvent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix case. 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 | « content/browser/renderer_host/input/web_input_event_util.cc ('k') | ui/events/event_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/event.h
diff --git a/ui/events/event.h b/ui/events/event.h
index 757d992c6afadea723c2629e56003c60ae1a7f02..2ad02fdb2e0b8960d9489f350bc77b9c00897127 100644
--- a/ui/events/event.h
+++ b/ui/events/event.h
@@ -518,8 +518,10 @@ class EVENTS_EXPORT TouchEvent : public LocatedEvent {
int touch_id() const { return touch_id_; }
// A unique identifier for this event.
uint64 unique_event_id() const { return unique_event_id_; }
- float radius_x() const { return radius_x_; }
- float radius_y() const { return radius_y_; }
+ // If we aren't provided with a radius on one axis, use the
+ // information from the other axis.
+ float radius_x() const { return radius_x_ > 0 ? radius_x_ : radius_y_; }
+ float radius_y() const { return radius_y_ > 0 ? radius_y_ : radius_x_; }
float rotation_angle() const { return rotation_angle_; }
float force() const { return force_; }
« no previous file with comments | « content/browser/renderer_host/input/web_input_event_util.cc ('k') | ui/events/event_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698