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

Side by Side Diff: ui/aura/event.cc

Issue 10175002: Fix scaling for aura::GestureEvent and aura::TouchEvent (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed GestureEvent handling Created 8 years, 8 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') | no next file » | 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
11 #include <cstring> 11 #include <cstring>
12 12
13 #include "ui/aura/window.h" 13 #include "ui/aura/window.h"
14 #include "ui/base/keycodes/keyboard_code_conversion.h" 14 #include "ui/base/keycodes/keyboard_code_conversion.h"
15 #include "ui/gfx/point3.h" 15 #include "ui/gfx/point3.h"
16 #include "ui/gfx/interpolated_transform.h"
16 #include "ui/gfx/transform.h" 17 #include "ui/gfx/transform.h"
17 18
18 #if defined(OS_MACOSX) 19 #if defined(OS_MACOSX)
19 #include "ui/aura/event_mac.h" 20 #include "ui/aura/event_mac.h"
20 #endif 21 #endif
21 22
22 #if defined(USE_X11) 23 #if defined(USE_X11)
23 #include "ui/base/keycodes/keyboard_code_conversion_x.h" 24 #include "ui/base/keycodes/keyboard_code_conversion_x.h"
24 #endif 25 #endif
25 26
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 radius_x_(1.0f), 274 radius_x_(1.0f),
274 radius_y_(1.0f), 275 radius_y_(1.0f),
275 rotation_angle_(0.0f), 276 rotation_angle_(0.0f),
276 force_(0.0f) { 277 force_(0.0f) {
277 set_time_stamp(time_stamp); 278 set_time_stamp(time_stamp);
278 } 279 }
279 280
280 TouchEvent::~TouchEvent() { 281 TouchEvent::~TouchEvent() {
281 } 282 }
282 283
284 void TouchEvent::UpdateForRootTransform(const ui::Transform& root_transform) {
285 LocatedEvent::UpdateForRootTransform(root_transform);
286 gfx::Point3f scale;
287 ui::InterpolatedTransform::FactorTRS(root_transform, NULL, NULL, &scale);
288 radius_x_ *= scale.x();
289 radius_y_ *= scale.y();
290 }
291
283 ui::EventType TouchEvent::GetEventType() const { 292 ui::EventType TouchEvent::GetEventType() const {
284 return type(); 293 return type();
285 } 294 }
286 295
287 gfx::Point TouchEvent::GetLocation() const { 296 gfx::Point TouchEvent::GetLocation() const {
288 return location(); 297 return location();
289 } 298 }
290 299
291 int TouchEvent::GetTouchId() const { 300 int TouchEvent::GetTouchId() const {
292 return touch_id_; 301 return touch_id_;
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 int GestureEvent::GetLowestTouchId() const { 466 int GestureEvent::GetLowestTouchId() const {
458 if (touch_ids_bitfield_ == 0) 467 if (touch_ids_bitfield_ == 0)
459 return -1; 468 return -1;
460 int i = -1; 469 int i = -1;
461 // Find the index of the least significant 1 bit 470 // Find the index of the least significant 1 bit
462 while (!(1 << ++i & touch_ids_bitfield_)); 471 while (!(1 << ++i & touch_ids_bitfield_));
463 return i; 472 return i;
464 } 473 }
465 474
466 } // namespace aura 475 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/event.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698