Chromium Code Reviews| 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/events/event.h" | 5 #include "ui/events/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 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 718 CHECK(IsScrollEvent()); | 718 CHECK(IsScrollEvent()); |
| 719 } | 719 } |
| 720 | 720 |
| 721 void ScrollEvent::Scale(const float factor) { | 721 void ScrollEvent::Scale(const float factor) { |
| 722 x_offset_ *= factor; | 722 x_offset_ *= factor; |
| 723 y_offset_ *= factor; | 723 y_offset_ *= factor; |
| 724 x_offset_ordinal_ *= factor; | 724 x_offset_ordinal_ *= factor; |
| 725 y_offset_ordinal_ *= factor; | 725 y_offset_ordinal_ *= factor; |
| 726 } | 726 } |
| 727 | 727 |
| 728 void ScrollEvent::UpdateForRootTransform( | 728 void ScrollEvent::UpdateForRootTransform( |
|
sadrul
2013/10/01 11:17:06
You should just remove this override.
| |
| 729 const gfx::Transform& inverted_root_transform) { | 729 const gfx::Transform& inverted_root_transform) { |
| 730 LocatedEvent::UpdateForRootTransform(inverted_root_transform); | 730 LocatedEvent::UpdateForRootTransform(inverted_root_transform); |
| 731 gfx::DecomposedTransform decomp; | |
| 732 bool success = gfx::DecomposeTransform(&decomp, inverted_root_transform); | |
| 733 DCHECK(success); | |
| 734 if (decomp.scale[0]) | |
| 735 x_offset_ordinal_ *= decomp.scale[0]; | |
| 736 if (decomp.scale[1]) | |
| 737 y_offset_ordinal_ *= decomp.scale[1]; | |
| 738 } | 731 } |
| 739 | 732 |
| 740 //////////////////////////////////////////////////////////////////////////////// | 733 //////////////////////////////////////////////////////////////////////////////// |
| 741 // GestureEvent | 734 // GestureEvent |
| 742 | 735 |
| 743 GestureEvent::GestureEvent(EventType type, | 736 GestureEvent::GestureEvent(EventType type, |
| 744 int x, | 737 int x, |
| 745 int y, | 738 int y, |
| 746 int flags, | 739 int flags, |
| 747 base::TimeDelta time_stamp, | 740 base::TimeDelta time_stamp, |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 762 int GestureEvent::GetLowestTouchId() const { | 755 int GestureEvent::GetLowestTouchId() const { |
| 763 if (touch_ids_bitfield_ == 0) | 756 if (touch_ids_bitfield_ == 0) |
| 764 return -1; | 757 return -1; |
| 765 int i = -1; | 758 int i = -1; |
| 766 // Find the index of the least significant 1 bit | 759 // Find the index of the least significant 1 bit |
| 767 while (!(1 << ++i & touch_ids_bitfield_)); | 760 while (!(1 << ++i & touch_ids_bitfield_)); |
| 768 return i; | 761 return i; |
| 769 } | 762 } |
| 770 | 763 |
| 771 } // namespace ui | 764 } // namespace ui |
| OLD | NEW |