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

Unified Diff: ui/events/event.h

Issue 800163005: Fixed ui::TouchEvent rotation angle out-of-bound issue. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | ui/events/event.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 754f5c90aaaddd879d5ae7a9888a0b2631302cd9..e32e77c6700ca50b35a6224b07774cd763be9661 100644
--- a/ui/events/event.h
+++ b/ui/events/event.h
@@ -542,19 +542,10 @@ class EVENTS_EXPORT TouchEvent : public LocatedEvent {
return !!(result() & ER_DISABLE_SYNC_HANDLING);
}
- protected:
- void set_radius(float radius_x, float radius_y) {
- radius_x_ = radius_x;
- radius_y_ = radius_y;
- }
-
- void set_rotation_angle(float rotation_angle) {
- rotation_angle_ = rotation_angle;
- }
-
- void set_force(float force) { force_ = force; }
-
private:
+ // Adjusts rotation_angle_ to within the acceptable range.
+ void fixRotationAngle();
+
// The identity (typically finger) of the touch starting at 0 and incrementing
// for each separable additional touch that the hardware can detect.
const int touch_id_;
@@ -568,7 +559,8 @@ class EVENTS_EXPORT TouchEvent : public LocatedEvent {
// Radius of the Y (minor) axis of the touch ellipse. 0.0 if unknown.
float radius_y_;
- // Angle of the major axis away from the X axis. Default 0.0.
+ // Clockwise angle (in degrees) of the major axis from the X axis. Must be
+ // less than 180 and non-negative.
float rotation_angle_;
// Force (pressure) of the touch. Normalized to be [0, 1]. Default to be 0.0.
« no previous file with comments | « no previous file | ui/events/event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698