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

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

Issue 822803005: Correct missing radius in ui::TouchEvent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix case. 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
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 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 float radius_y, 511 float radius_y,
512 float angle, 512 float angle,
513 float force); 513 float force);
514 514
515 ~TouchEvent() override; 515 ~TouchEvent() override;
516 516
517 // The id of the pointer this event modifies. 517 // The id of the pointer this event modifies.
518 int touch_id() const { return touch_id_; } 518 int touch_id() const { return touch_id_; }
519 // A unique identifier for this event. 519 // A unique identifier for this event.
520 uint64 unique_event_id() const { return unique_event_id_; } 520 uint64 unique_event_id() const { return unique_event_id_; }
521 float radius_x() const { return radius_x_; } 521 // If we aren't provided with a radius on one axis, use the
522 float radius_y() const { return radius_y_; } 522 // information from the other axis.
523 float radius_x() const { return radius_x_ > 0 ? radius_x_ : radius_y_; }
524 float radius_y() const { return radius_y_ > 0 ? radius_y_ : radius_x_; }
523 float rotation_angle() const { return rotation_angle_; } 525 float rotation_angle() const { return rotation_angle_; }
524 float force() const { return force_; } 526 float force() const { return force_; }
525 527
526 void set_may_cause_scrolling(bool causes) { may_cause_scrolling_ = causes; } 528 void set_may_cause_scrolling(bool causes) { may_cause_scrolling_ = causes; }
527 bool may_cause_scrolling() const { return may_cause_scrolling_; } 529 bool may_cause_scrolling() const { return may_cause_scrolling_; }
528 530
529 // Used for unit tests. 531 // Used for unit tests.
530 void set_radius_x(const float r) { radius_x_ = r; } 532 void set_radius_x(const float r) { radius_x_ = r; }
531 void set_radius_y(const float r) { radius_y_ = r; } 533 void set_radius_y(const float r) { radius_y_ = r; }
532 534
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
874 876
875 const GestureEventDetails& details() const { return details_; } 877 const GestureEventDetails& details() const { return details_; }
876 878
877 private: 879 private:
878 GestureEventDetails details_; 880 GestureEventDetails details_;
879 }; 881 };
880 882
881 } // namespace ui 883 } // namespace ui
882 884
883 #endif // UI_EVENTS_EVENT_H_ 885 #endif // UI_EVENTS_EVENT_H_
OLDNEW
« no previous file with comments | « content/browser/renderer_host/input/web_input_event_util.cc ('k') | ui/events/event_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698