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

Unified Diff: ui/base/gestures/gesture_types.h

Issue 10808083: gesture recognizer: Expose bounding-box for the points in a gesture-event. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge Created 8 years, 5 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
« no previous file with comments | « ui/base/gestures/gesture_sequence.cc ('k') | ui/base/gestures/gesture_types.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/gestures/gesture_types.h
diff --git a/ui/base/gestures/gesture_types.h b/ui/base/gestures/gesture_types.h
index 6dd39b6d937b8c65eb55c296fcf796a857b89177..56dad14df12890f0aa970cb0369c9c457f4f71ac 100644
--- a/ui/base/gestures/gesture_types.h
+++ b/ui/base/gestures/gesture_types.h
@@ -8,6 +8,7 @@
#include "base/logging.h"
#include "base/time.h"
#include "ui/base/events.h"
+#include "ui/gfx/rect.h"
namespace ui {
@@ -20,6 +21,9 @@ struct UI_EXPORT GestureEventDetails {
int touch_points() const { return touch_points_; }
void set_touch_points(int touch_points) { touch_points_ = touch_points; }
+ const gfx::Rect& bounding_box() const { return bounding_box_; }
+ void set_bounding_box(const gfx::Rect& box) { bounding_box_ = box; }
+
float scroll_x() const {
CHECK_EQ(ui::ET_GESTURE_SCROLL_UPDATE, type_);
return data.scroll.x;
@@ -38,15 +42,6 @@ struct UI_EXPORT GestureEventDetails {
return data.velocity.y;
}
- float radius_x() const {
- CHECK_EQ(ui::ET_GESTURE_TAP, type_);
- return data.radius.x;
- }
- float radius_y() const {
- CHECK_EQ(ui::ET_GESTURE_TAP, type_);
- return data.radius.y;
- }
-
int touch_id() const {
CHECK_EQ(ui::ET_GESTURE_LONG_PRESS, type_);
return data.touch_id;
@@ -97,11 +92,6 @@ struct UI_EXPORT GestureEventDetails {
float y;
} velocity;
- struct { // TAP radius.
- float x;
- float y;
- } radius;
-
int touch_id; // LONG_PRESS touch-id.
struct { // SWIPE direction.
@@ -118,6 +108,10 @@ struct UI_EXPORT GestureEventDetails {
} data;
int touch_points_; // Number of active touch points in the gesture.
+
+ // Bounding box is an axis-aligned rectangle that contains all the
+ // enclosing rectangles of the touch-points in the gesture.
+ gfx::Rect bounding_box_;
};
// An abstract type to represent touch-events. The gesture-recognizer uses this
« no previous file with comments | « ui/base/gestures/gesture_sequence.cc ('k') | ui/base/gestures/gesture_types.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698