diff options
author | danakj <danakj@chromium.org> | 2015-10-22 17:04:36 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-10-23 00:05:28 +0000 |
commit | 05558ce51d776aee1b12104a2d6aba7971b77442 (patch) | |
tree | 5a2bd829b43ff973f6d09759e56e524c0c79539d /ui | |
parent | f72d927cdfb1b9a4c3db0a06907238a3cac3dbb0 (diff) | |
download | chromium_src-05558ce51d776aee1b12104a2d6aba7971b77442.zip chromium_src-05558ce51d776aee1b12104a2d6aba7971b77442.tar.gz chromium_src-05558ce51d776aee1b12104a2d6aba7971b77442.tar.bz2 |
Don't drop the floating point part of events when converting types.
A few places that make an event out of another event use the location()
instead of the location_f() which means they drop the floating point
part of the original event.
R=sadrul, sky
BUG=342848
Review URL: https://codereview.chromium.org/1423703002
Cr-Commit-Position: refs/heads/master@{#355682}
Diffstat (limited to 'ui')
-rw-r--r-- | ui/aura/window_targeter.cc | 5 | ||||
-rw-r--r-- | ui/events/gestures/motion_event_aura.cc | 2 | ||||
-rw-r--r-- | ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc | 3 |
3 files changed, 5 insertions, 5 deletions
diff --git a/ui/aura/window_targeter.cc b/ui/aura/window_targeter.cc index 192bd60..df4e064 100644 --- a/ui/aura/window_targeter.cc +++ b/ui/aura/window_targeter.cc @@ -152,9 +152,8 @@ Window* WindowTargeter::FindTargetInRootWindow(Window* root_window, ui::GestureRecognizer::Get()->GetTouchLockedTarget(touch); if (consumer) return static_cast<Window*>(consumer); - consumer = - ui::GestureRecognizer::Get()->GetTargetForLocation( - event.location(), touch.source_device_id()); + consumer = ui::GestureRecognizer::Get()->GetTargetForLocation( + event.location_f(), touch.source_device_id()); if (consumer) return static_cast<Window*>(consumer); diff --git a/ui/events/gestures/motion_event_aura.cc b/ui/events/gestures/motion_event_aura.cc index 54139e5..6890753 100644 --- a/ui/events/gestures/motion_event_aura.cc +++ b/ui/events/gestures/motion_event_aura.cc @@ -54,7 +54,7 @@ bool MotionEventAura::OnTouch(const TouchEvent& touch) { // crbug.com/446852 for details. // Cancel the existing touch, before handling the touch press. - TouchEvent cancel(ET_TOUCH_CANCELLED, touch.location(), touch.touch_id(), + TouchEvent cancel(ET_TOUCH_CANCELLED, touch.location_f(), touch.touch_id(), touch.time_stamp()); OnTouch(cancel); CleanupRemovedTouchPoints(cancel); diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc index ed0cb1d..a184fe91 100644 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc @@ -1536,7 +1536,8 @@ void DesktopWindowTreeHostX11::ConvertEventToDifferentHost( display_dest.device_scale_factor()); gfx::Vector2d offset = GetLocationOnNativeScreen() - host->GetLocationOnNativeScreen(); - gfx::Point location_in_pixel_in_host = located_event->location() + offset; + gfx::PointF location_in_pixel_in_host = + located_event->location_f() + gfx::Vector2dF(offset); located_event->set_location(location_in_pixel_in_host); } |