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

Unified Diff: ui/events/gestures/motion_event_aura.cc

Issue 800163005: Fixed ui::TouchEvent rotation angle out-of-bound issue. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed few unsed setters from ui::TouchEvent 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
« ui/events/event.cc ('K') | « ui/events/event.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/gestures/motion_event_aura.cc
diff --git a/ui/events/gestures/motion_event_aura.cc b/ui/events/gestures/motion_event_aura.cc
index 1f4d2855b2fc0cfc5d3cd32495f5586d6f6cea13..a6ff09e090182bbd300dd74f11fe9ec91ca4c7b0 100644
--- a/ui/events/gestures/motion_event_aura.cc
+++ b/ui/events/gestures/motion_event_aura.cc
@@ -28,6 +28,14 @@ PointerProperties GetPointerPropertiesFromTouchEvent(const TouchEvent& touch) {
float radius_x = touch.radius_x();
float radius_y = touch.radius_y();
float rotation_angle_rad = touch.rotation_angle() * M_PI / 180.f;
+
+ if (rotation_angle_rad < 0) {
tdresser 2015/01/20 13:36:39 You might want to clarify why you're doing this, a
mustaq 2015/01/20 16:26:46 Done.
+ rotation_angle_rad += M_PI_2;
+ float tmp = radius_x;
tdresser 2015/01/20 13:36:39 Use std::swap.
mustaq 2015/01/20 16:26:46 Done.
+ radius_x = radius_y;
+ radius_y = tmp;
+ }
+
DCHECK_GE(radius_x, 0) << "Unexpected x-radius < 0";
DCHECK_GE(radius_y, 0) << "Unexpected y-radius < 0";
DCHECK(0 <= rotation_angle_rad && rotation_angle_rad <= M_PI_2)
« ui/events/event.cc ('K') | « ui/events/event.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698