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

Unified Diff: ui/aura/event.cc

Issue 10383249: touch: Make sure the correct radius values are used for touch events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: non-zero-scale Created 8 years, 7 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/aura/event.h ('k') | ui/base/x/events_x.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/event.cc
diff --git a/ui/aura/event.cc b/ui/aura/event.cc
index 0d9f590b040b9f5308af553a0eb8505f70e50483..a4c990cdf7bf104b215dcd064f62bfee12688e5a 100644
--- a/ui/aura/event.cc
+++ b/ui/aura/event.cc
@@ -271,8 +271,8 @@ TouchEvent::TouchEvent(ui::EventType type,
base::TimeDelta time_stamp)
: LocatedEvent(type, location, location, 0),
touch_id_(touch_id),
- radius_x_(1.0f),
- radius_y_(1.0f),
+ radius_x_(0.0f),
+ radius_y_(0.0f),
rotation_angle_(0.0f),
force_(0.0f) {
set_time_stamp(time_stamp);
@@ -285,8 +285,10 @@ void TouchEvent::UpdateForRootTransform(const ui::Transform& root_transform) {
LocatedEvent::UpdateForRootTransform(root_transform);
gfx::Point3f scale;
ui::InterpolatedTransform::FactorTRS(root_transform, NULL, NULL, &scale);
- radius_x_ *= scale.x();
- radius_y_ *= scale.y();
+ if (scale.x())
+ radius_x_ /= scale.x();
+ if (scale.y())
+ radius_y_ /= scale.y();
}
ui::EventType TouchEvent::GetEventType() const {
« no previous file with comments | « ui/aura/event.h ('k') | ui/base/x/events_x.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698