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

Side by Side Diff: ui/events/event.h

Issue 800163005: Fixed ui::TouchEvent rotation angle out-of-bound issue. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/events/event.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_EVENT_H_ 5 #ifndef UI_EVENTS_EVENT_H_
6 #define UI_EVENTS_EVENT_H_ 6 #define UI_EVENTS_EVENT_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/event_types.h" 10 #include "base/event_types.h"
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 } 543 }
544 544
545 protected: 545 protected:
546 void set_radius(float radius_x, float radius_y) { 546 void set_radius(float radius_x, float radius_y) {
547 radius_x_ = radius_x; 547 radius_x_ = radius_x;
548 radius_y_ = radius_y; 548 radius_y_ = radius_y;
549 } 549 }
550 550
551 void set_rotation_angle(float rotation_angle) { 551 void set_rotation_angle(float rotation_angle) {
552 rotation_angle_ = rotation_angle; 552 rotation_angle_ = rotation_angle;
553 fixRotationAngle();
553 } 554 }
554 555
555 void set_force(float force) { force_ = force; } 556 void set_force(float force) { force_ = force; }
556 557
557 private: 558 private:
558 // The identity (typically finger) of the touch starting at 0 and incrementing 559 // The identity (typically finger) of the touch starting at 0 and incrementing
559 // for each separable additional touch that the hardware can detect. 560 // for each separable additional touch that the hardware can detect.
560 const int touch_id_; 561 const int touch_id_;
561 562
562 // A unique identifier for the touch event. 563 // A unique identifier for the touch event.
563 const uint64 unique_event_id_; 564 const uint64 unique_event_id_;
564 565
565 // Radius of the X (major) axis of the touch ellipse. 0.0 if unknown. 566 // Radius of the X (major) axis of the touch ellipse. 0.0 if unknown.
566 float radius_x_; 567 float radius_x_;
567 568
568 // Radius of the Y (minor) axis of the touch ellipse. 0.0 if unknown. 569 // Radius of the Y (minor) axis of the touch ellipse. 0.0 if unknown.
569 float radius_y_; 570 float radius_y_;
570 571
571 // Angle of the major axis away from the X axis. Default 0.0. 572 // Angle of the major axis away from the X axis. Default 0.0.
572 float rotation_angle_; 573 float rotation_angle_;
573 574
574 // Force (pressure) of the touch. Normalized to be [0, 1]. Default to be 0.0. 575 // Force (pressure) of the touch. Normalized to be [0, 1]. Default to be 0.0.
575 float force_; 576 float force_;
576 577
577 // Whether the (unhandled) touch event will produce a scroll event (e.g., a 578 // Whether the (unhandled) touch event will produce a scroll event (e.g., a
578 // touchmove that exceeds the platform slop region, or a touchend that 579 // touchmove that exceeds the platform slop region, or a touchend that
579 // causes a fling). Defaults to false. 580 // causes a fling). Defaults to false.
580 bool may_cause_scrolling_; 581 bool may_cause_scrolling_;
582
583 // Adjusts rotation_angle_ to within the spec limits:
584 // https://dvcs.w3.org/hg/webevents/raw-file/default/touchevents.html
tdresser 2015/01/16 20:29:52 As we're in the ui layer here, I don't think we wa
585 void fixRotationAngle();
581 }; 586 };
582 587
583 // An interface that individual platforms can use to store additional data on 588 // An interface that individual platforms can use to store additional data on
584 // KeyEvent. 589 // KeyEvent.
585 // 590 //
586 // Currently only used in mojo. 591 // Currently only used in mojo.
587 class EVENTS_EXPORT ExtendedKeyEventData { 592 class EVENTS_EXPORT ExtendedKeyEventData {
588 public: 593 public:
589 virtual ~ExtendedKeyEventData() {} 594 virtual ~ExtendedKeyEventData() {}
590 595
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
873 878
874 const GestureEventDetails& details() const { return details_; } 879 const GestureEventDetails& details() const { return details_; }
875 880
876 private: 881 private:
877 GestureEventDetails details_; 882 GestureEventDetails details_;
878 }; 883 };
879 884
880 } // namespace ui 885 } // namespace ui
881 886
882 #endif // UI_EVENTS_EVENT_H_ 887 #endif // UI_EVENTS_EVENT_H_
OLDNEW
« no previous file with comments | « no previous file | ui/events/event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698