Chromium Code Reviews| Index: ui/events/event.cc |
| diff --git a/ui/events/event.cc b/ui/events/event.cc |
| index 4c252d63639e476003615c17eeda5f79c6caed09..1877aaf69463df0c0370b5c284551510d63a4ebf 100644 |
| --- a/ui/events/event.cc |
| +++ b/ui/events/event.cc |
| @@ -535,6 +535,7 @@ TouchEvent::TouchEvent(const base::NativeEvent& native_event) |
| 1); |
| latency()->AddLatencyNumber(INPUT_EVENT_LATENCY_UI_COMPONENT, 0, 0); |
| + fixRotationAngle(); |
| if (type() == ET_TOUCH_PRESSED) |
| IncrementTouchIdRefCount(native_event); |
| @@ -573,6 +574,7 @@ TouchEvent::TouchEvent(EventType type, |
| force_(force), |
| may_cause_scrolling_(false) { |
| latency()->AddLatencyNumber(INPUT_EVENT_LATENCY_UI_COMPONENT, 0, 0); |
| + fixRotationAngle(); |
| } |
| TouchEvent::~TouchEvent() { |
| @@ -601,6 +603,11 @@ void TouchEvent::DisableSynchronousHandling() { |
| static_cast<EventResult>(result() | ER_DISABLE_SYNC_HANDLING)); |
| } |
| +void TouchEvent::fixRotationAngle() { |
|
tdresser
2015/01/20 13:36:39
The bounds are [-90, 90], correct? So this should
mustaq
2015/01/20 16:26:46
Good catch, thanks. I have adjusted the angle rang
|
| + if (rotation_angle_ <= -90 || rotation_angle_ >= 90) |
| + rotation_angle_ = fmod(rotation_angle_, 90); |
| +} |
| + |
| //////////////////////////////////////////////////////////////////////////////// |
| // KeyEvent |