| OLD | NEW |
| 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 Loading... |
| 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 if (scale.x()) |
| 289 radius_y_ *= scale.y(); | 289 radius_x_ /= scale.x(); |
| 290 if (scale.y()) |
| 291 radius_y_ /= scale.y(); |
| 290 } | 292 } |
| 291 | 293 |
| 292 ui::EventType TouchEvent::GetEventType() const { | 294 ui::EventType TouchEvent::GetEventType() const { |
| 293 return type(); | 295 return type(); |
| 294 } | 296 } |
| 295 | 297 |
| 296 gfx::Point TouchEvent::GetLocation() const { | 298 gfx::Point TouchEvent::GetLocation() const { |
| 297 return location(); | 299 return location(); |
| 298 } | 300 } |
| 299 | 301 |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 int GestureEvent::GetLowestTouchId() const { | 481 int GestureEvent::GetLowestTouchId() const { |
| 480 if (touch_ids_bitfield_ == 0) | 482 if (touch_ids_bitfield_ == 0) |
| 481 return -1; | 483 return -1; |
| 482 int i = -1; | 484 int i = -1; |
| 483 // Find the index of the least significant 1 bit | 485 // Find the index of the least significant 1 bit |
| 484 while (!(1 << ++i & touch_ids_bitfield_)); | 486 while (!(1 << ++i & touch_ids_bitfield_)); |
| 485 return i; | 487 return i; |
| 486 } | 488 } |
| 487 | 489 |
| 488 } // namespace aura | 490 } // namespace aura |
| OLD | NEW |