diff options
author | sadrul <sadrul@chromium.org> | 2015-06-25 10:25:31 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-25 17:26:04 +0000 |
commit | db5aa7abc8a6ed76f6497e25821c8a2f3e27f5af (patch) | |
tree | c8f2fed596e96fbf0ab93ec3d56bbfadb3447286 /ui/events/gesture_detection/motion_event_generic.h | |
parent | 716f37a898600a21c90ebd942983afb3aa38b747 (diff) | |
download | chromium_src-db5aa7abc8a6ed76f6497e25821c8a2f3e27f5af.zip chromium_src-db5aa7abc8a6ed76f6497e25821c8a2f3e27f5af.tar.gz chromium_src-db5aa7abc8a6ed76f6497e25821c8a2f3e27f5af.tar.bz2 |
html_viewer: Correctly set axis and orientation of MotionEvent.
MotionEvent's orientation is in radian, and it falls within [-π/2, π/2). However,
TouchEvent's rotation-angle is in degrees, and it falls within [0, 180). So make
sure the conversion from rotation-angle to orientation happens correctly. Add
PointerProperties::SetAxisAndOrientation() as a convenience function to do this
correctly.
This fixes a crash in mandoline when touching the screen in landspace mode.
BUG=none
Review URL: https://codereview.chromium.org/1202283005
Cr-Commit-Position: refs/heads/master@{#336187}
Diffstat (limited to 'ui/events/gesture_detection/motion_event_generic.h')
-rw-r--r-- | ui/events/gesture_detection/motion_event_generic.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ui/events/gesture_detection/motion_event_generic.h b/ui/events/gesture_detection/motion_event_generic.h index 6357342..2a9a606 100644 --- a/ui/events/gesture_detection/motion_event_generic.h +++ b/ui/events/gesture_detection/motion_event_generic.h @@ -18,6 +18,12 @@ struct GESTURE_DETECTION_EXPORT PointerProperties { PointerProperties(float x, float y, float touch_major); PointerProperties(const MotionEvent& event, size_t pointer_index); + // Sets |touch_major|, |touch_minor|, and |orientation| from the given radius + // and rotation angle (in degrees). + void SetAxesAndOrientation(float radius_x, + float radius_y, + float rotation_angle_degree); + int id; MotionEvent::ToolType tool_type; float x; |