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

Side by Side 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: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/aura/event.h ('k') | ui/base/x/events_x.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 #include "ui/aura/event.h" 5 #include "ui/aura/event.h"
6 6
7 #if defined(USE_X11) 7 #if defined(USE_X11)
8 #include <X11/Xlib.h> 8 #include <X11/Xlib.h>
9 #endif 9 #endif
10 10
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 rotation_angle_(model.rotation_angle_), 264 rotation_angle_(model.rotation_angle_),
265 force_(model.force_) { 265 force_(model.force_) {
266 } 266 }
267 267
268 TouchEvent::TouchEvent(ui::EventType type, 268 TouchEvent::TouchEvent(ui::EventType type,
269 const gfx::Point& location, 269 const gfx::Point& location,
270 int touch_id, 270 int touch_id,
271 base::TimeDelta time_stamp) 271 base::TimeDelta time_stamp)
272 : LocatedEvent(type, location, location, 0), 272 : LocatedEvent(type, location, location, 0),
273 touch_id_(touch_id), 273 touch_id_(touch_id),
274 radius_x_(1.0f), 274 radius_x_(0.0f),
275 radius_y_(1.0f), 275 radius_y_(0.0f),
276 rotation_angle_(0.0f), 276 rotation_angle_(0.0f),
277 force_(0.0f) { 277 force_(0.0f) {
278 set_time_stamp(time_stamp); 278 set_time_stamp(time_stamp);
279 } 279 }
280 280
281 TouchEvent::~TouchEvent() { 281 TouchEvent::~TouchEvent() {
282 } 282 }
283 283
284 void TouchEvent::UpdateForRootTransform(const ui::Transform& root_transform) { 284 void TouchEvent::UpdateForRootTransform(const ui::Transform& root_transform) {
285 LocatedEvent::UpdateForRootTransform(root_transform); 285 LocatedEvent::UpdateForRootTransform(root_transform);
286 gfx::Point3f scale; 286 gfx::Point3f scale;
287 ui::InterpolatedTransform::FactorTRS(root_transform, NULL, NULL, &scale); 287 ui::InterpolatedTransform::FactorTRS(root_transform, NULL, NULL, &scale);
288 radius_x_ *= scale.x(); 288 radius_x_ /= scale.x();
sky 2012/05/18 19:57:37 Are we sure these are non-zero?
sadrul 2012/05/18 20:07:32 Ah, good point. I think in normal cases, the scale
289 radius_y_ *= scale.y(); 289 radius_y_ /= scale.y();
290 } 290 }
291 291
292 ui::EventType TouchEvent::GetEventType() const { 292 ui::EventType TouchEvent::GetEventType() const {
293 return type(); 293 return type();
294 } 294 }
295 295
296 gfx::Point TouchEvent::GetLocation() const { 296 gfx::Point TouchEvent::GetLocation() const {
297 return location(); 297 return location();
298 } 298 }
299 299
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 int GestureEvent::GetLowestTouchId() const { 463 int GestureEvent::GetLowestTouchId() const {
464 if (touch_ids_bitfield_ == 0) 464 if (touch_ids_bitfield_ == 0)
465 return -1; 465 return -1;
466 int i = -1; 466 int i = -1;
467 // Find the index of the least significant 1 bit 467 // Find the index of the least significant 1 bit
468 while (!(1 << ++i & touch_ids_bitfield_)); 468 while (!(1 << ++i & touch_ids_bitfield_));
469 return i; 469 return i;
470 } 470 }
471 471
472 } // namespace aura 472 } // namespace aura
OLDNEW
« 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