| 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( | |
| 729 const gfx::Transform& 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 } | |
| 739 | |
| 740 //////////////////////////////////////////////////////////////////////////////// | 728 //////////////////////////////////////////////////////////////////////////////// |
| 741 // GestureEvent | 729 // GestureEvent |
| 742 | 730 |
| 743 GestureEvent::GestureEvent(EventType type, | 731 GestureEvent::GestureEvent(EventType type, |
| 744 int x, | 732 int x, |
| 745 int y, | 733 int y, |
| 746 int flags, | 734 int flags, |
| 747 base::TimeDelta time_stamp, | 735 base::TimeDelta time_stamp, |
| 748 const GestureEventDetails& details, | 736 const GestureEventDetails& details, |
| 749 unsigned int touch_ids_bitfield) | 737 unsigned int touch_ids_bitfield) |
| (...skipping 12 matching lines...) Expand all Loading... |
| 762 int GestureEvent::GetLowestTouchId() const { | 750 int GestureEvent::GetLowestTouchId() const { |
| 763 if (touch_ids_bitfield_ == 0) | 751 if (touch_ids_bitfield_ == 0) |
| 764 return -1; | 752 return -1; |
| 765 int i = -1; | 753 int i = -1; |
| 766 // Find the index of the least significant 1 bit | 754 // Find the index of the least significant 1 bit |
| 767 while (!(1 << ++i & touch_ids_bitfield_)); | 755 while (!(1 << ++i & touch_ids_bitfield_)); |
| 768 return i; | 756 return i; |
| 769 } | 757 } |
| 770 | 758 |
| 771 } // namespace ui | 759 } // namespace ui |
| OLD | NEW |