summaryrefslogtreecommitdiffstats
path: root/ui/views/events
diff options
context:
space:
mode:
authortdanderson@chromium.org <tdanderson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-17 22:29:56 +0000
committertdanderson@chromium.org <tdanderson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-17 22:29:56 +0000
commit748bd3ad873b96f0295f29f71f386dc587c3845c (patch)
treefbc21f74071818bd082a5f3e8f8fa0d96d0dd777 /ui/views/events
parent50ff938086c1529a955330a5bfc361fcf113956e (diff)
downloadchromium_src-748bd3ad873b96f0295f29f71f386dc587c3845c.zip
chromium_src-748bd3ad873b96f0295f29f71f386dc587c3845c.tar.gz
chromium_src-748bd3ad873b96f0295f29f71f386dc587c3845c.tar.bz2
Compute the enclosing rectangle for circles/ellipses generated from a series of touch events
For a sequence of {touchstart, touchmove*, touchend} events, compute the rectangle that encloses all of the circles/ellipses corresponding to the touch events. If the hardware is capable of collecting radius_x or radius_y, use the maximum of these two values as the radii values for the touch region. Otherwise use a default radius value of 15. BUG=122190 TEST=none Review URL: https://chromiumcodereview.appspot.com/10262023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137753 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/events')
-rw-r--r--ui/views/events/event.cc16
-rw-r--r--ui/views/events/event.h4
2 files changed, 20 insertions, 0 deletions
diff --git a/ui/views/events/event.cc b/ui/views/events/event.cc
index 6954db6..fa8ce36 100644
--- a/ui/views/events/event.cc
+++ b/ui/views/events/event.cc
@@ -171,6 +171,22 @@ TouchEvent* TouchEvent::Copy() const {
flags(), touch_id_, radius_x_, radius_y_, rotation_angle_, force_);
}
+float TouchEvent::RadiusX() const {
+ return radius_x_;
+}
+
+float TouchEvent::RadiusY() const {
+ return radius_y_;
+}
+
+float TouchEvent::RotationAngle() const {
+ return rotation_angle_;
+}
+
+float TouchEvent::Force() const {
+ return force_;
+}
+
////////////////////////////////////////////////////////////////////////////////
// TouchEvent, private:
diff --git a/ui/views/events/event.h b/ui/views/events/event.h
index 46a9e2b..425bb1c 100644
--- a/ui/views/events/event.h
+++ b/ui/views/events/event.h
@@ -248,6 +248,10 @@ class VIEWS_EXPORT TouchEvent : public LocatedEvent,
virtual int GetEventFlags() const OVERRIDE;
virtual base::TimeDelta GetTimestamp() const OVERRIDE;
virtual TouchEvent* Copy() const OVERRIDE;
+ virtual float RadiusX() const OVERRIDE;
+ virtual float RadiusY() const OVERRIDE;
+ virtual float RotationAngle() const OVERRIDE;
+ virtual float Force() const OVERRIDE;
private:
friend class internal::RootView;