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

Side by Side Diff: ui/events/gesture_detection/motion_event.h

Issue 1152463004: Fix motion event orientation handling for styluses. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_EVENTS_GESTURE_DETECTION_MOTION_EVENT_H_ 5 #ifndef UI_EVENTS_GESTURE_DETECTION_MOTION_EVENT_H_
6 #define UI_EVENTS_GESTURE_DETECTION_MOTION_EVENT_H_ 6 #define UI_EVENTS_GESTURE_DETECTION_MOTION_EVENT_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "ui/events/gesture_detection/gesture_detection_export.h" 10 #include "ui/events/gesture_detection/gesture_detection_export.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 float GetX() const { return GetX(0); } 85 float GetX() const { return GetX(0); }
86 float GetY() const { return GetY(0); } 86 float GetY() const { return GetY(0); }
87 float GetRawX() const { return GetRawX(0); } 87 float GetRawX() const { return GetRawX(0); }
88 float GetRawY() const { return GetRawY(0); } 88 float GetRawY() const { return GetRawY(0); }
89 float GetRawOffsetX() const { return GetRawX() - GetX(); } 89 float GetRawOffsetX() const { return GetRawX() - GetX(); }
90 float GetRawOffsetY() const { return GetRawY() - GetY(); } 90 float GetRawOffsetY() const { return GetRawY() - GetY(); }
91 91
92 float GetTouchMajor() const { return GetTouchMajor(0); } 92 float GetTouchMajor() const { return GetTouchMajor(0); }
93 float GetTouchMinor() const { return GetTouchMinor(0); } 93 float GetTouchMinor() const { return GetTouchMinor(0); }
94 94
95 // Returns the orientation of the major axis clockwise from vertical, in 95 // Returns the orientation of the major axis clockwise from vertical, in
Rick Byers 2015/05/26 20:21:33 For stylus this isn't really returning "the orient
USE eero AT chromium.org 2015/05/27 08:39:39 Done.
96 // radians. The return value lies in [-PI/2, PI/2]. 96 // radians. The return value lies in [-PI, PI] (for a stylus) or in
97 // [-PI/2, PI/2] (for a touch screen or pad).
97 float GetOrientation() const { return GetOrientation(0); } 98 float GetOrientation() const { return GetOrientation(0); }
98 99
99 float GetPressure() const { return GetPressure(0); } 100 float GetPressure() const { return GetPressure(0); }
100 ToolType GetToolType() const { return GetToolType(0); } 101 ToolType GetToolType() const { return GetToolType(0); }
101 102
102 // O(N) search of pointers (use sparingly!). Returns -1 if |id| nonexistent. 103 // O(N) search of pointers (use sparingly!). Returns -1 if |id| nonexistent.
103 int FindPointerIndexOfId(int id) const; 104 int FindPointerIndexOfId(int id) const;
104 105
105 // Note that these methods perform shallow copies of the originating events. 106 // Note that these methods perform shallow copies of the originating events.
106 // They guarantee only that the returned type will reflect the same 107 // They guarantee only that the returned type will reflect the same
107 // data exposed by the MotionEvent interface; no guarantees are made that the 108 // data exposed by the MotionEvent interface; no guarantees are made that the
108 // underlying implementation is identical to the source implementation. 109 // underlying implementation is identical to the source implementation.
109 scoped_ptr<MotionEvent> Clone() const; 110 scoped_ptr<MotionEvent> Clone() const;
110 scoped_ptr<MotionEvent> Cancel() const; 111 scoped_ptr<MotionEvent> Cancel() const;
111 }; 112 };
112 113
113 } // namespace ui 114 } // namespace ui
114 115
115 #endif // UI_EVENTS_GESTURE_DETECTION_MOTION_EVENT_H_ 116 #endif // UI_EVENTS_GESTURE_DETECTION_MOTION_EVENT_H_
OLDNEW
« ui/events/blink/blink_event_util.cc ('K') | « ui/events/blink/blink_event_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698