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

Unified Diff: ui/events/event.h

Issue 755403006: Added experimental Touch.tilt, Touch.tiltDirection support for Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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: ui/events/event.h
diff --git a/ui/events/event.h b/ui/events/event.h
index 56fd74c85d53d17d000fa1b9c6c0796104379056..f919449982062c4f2c38e57cb262e40e6ace3ab4 100644
--- a/ui/events/event.h
+++ b/ui/events/event.h
@@ -491,6 +491,7 @@ class EVENTS_EXPORT TouchEvent : public LocatedEvent {
radius_x_(model.radius_x_),
radius_y_(model.radius_y_),
rotation_angle_(model.rotation_angle_),
+ tilt_(model.tilt_),
force_(model.force_) {
}
@@ -507,6 +508,7 @@ class EVENTS_EXPORT TouchEvent : public LocatedEvent {
float radius_x,
float radius_y,
float angle,
+ float tilt,
float force);
~TouchEvent() override;
@@ -515,6 +517,7 @@ class EVENTS_EXPORT TouchEvent : public LocatedEvent {
float radius_x() const { return radius_x_; }
float radius_y() const { return radius_y_; }
float rotation_angle() const { return rotation_angle_; }
+ float tilt() const { return tilt_; }
float force() const { return force_; }
// Used for unit tests.
@@ -535,6 +538,10 @@ class EVENTS_EXPORT TouchEvent : public LocatedEvent {
rotation_angle_ = rotation_angle;
}
+ void set_tilt(float tilt) {
+ tilt_ = tilt;
+ }
+
void set_force(float force) { force_ = force; }
private:
@@ -551,6 +558,10 @@ class EVENTS_EXPORT TouchEvent : public LocatedEvent {
// Angle of the major axis away from the X axis. Default 0.0.
float rotation_angle_;
+ // Tilt angle of the stylus away from the perpendicular to the screen.
+ // Default is 0.0.
+ float tilt_;
+
// Force (pressure) of the touch. Normalized to be [0, 1]. Default to be 0.0.
float force_;
};

Powered by Google App Engine
This is Rietveld 408576698