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

Unified Diff: ui/events/blink/web_input_event.cc

Issue 2782893002: WebMouseEvent coordinates are now fractional & private (Closed)
Patch Set: Fixed a compile failure Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: ui/events/blink/web_input_event.cc
diff --git a/ui/events/blink/web_input_event.cc b/ui/events/blink/web_input_event.cc
index a059c383fb88e9e336805c896cf62e02cd0d8741..230359da2eb138084bf405821ed374f6cc91dff8 100644
--- a/ui/events/blink/web_input_event.cc
+++ b/ui/events/blink/web_input_event.cc
@@ -235,8 +235,7 @@ blink::WebMouseEvent MakeWebMouseEvent(
#endif
// Replace the event's coordinate fields with translated position data from
// |event|.
- webkit_event.x = event.x();
- webkit_event.y = event.y();
+ webkit_event.setPositionInWidget(event.x(), event.y());
#if defined(OS_WIN)
if (event.native_event().message)
@@ -245,8 +244,7 @@ blink::WebMouseEvent MakeWebMouseEvent(
const gfx::Point screen_point =
GetScreenLocationFromEvent(event, screen_location_callback);
- webkit_event.globalX = screen_point.x();
- webkit_event.globalY = screen_point.y();
+ webkit_event.setPositionInScreen(screen_point.x(), screen_point.y());
return webkit_event;
}
@@ -271,13 +269,11 @@ blink::WebMouseWheelEvent MakeWebMouseWheelEvent(
// Replace the event's coordinate fields with translated position data from
// |event|.
- webkit_event.x = event.x();
- webkit_event.y = event.y();
+ webkit_event.setPositionInWidget(event.x(), event.y());
const gfx::Point screen_point =
GetScreenLocationFromEvent(event, screen_location_callback);
- webkit_event.globalX = screen_point.x();
- webkit_event.globalY = screen_point.y();
+ webkit_event.setPositionInScreen(screen_point.x(), screen_point.y());
return webkit_event;
}
@@ -302,13 +298,11 @@ blink::WebMouseWheelEvent MakeWebMouseWheelEvent(
// Replace the event's coordinate fields with translated position data from
// |event|.
- webkit_event.x = event.x();
- webkit_event.y = event.y();
+ webkit_event.setPositionInWidget(event.x(), event.y());
const gfx::Point screen_point =
GetScreenLocationFromEvent(event, screen_location_callback);
- webkit_event.globalX = screen_point.x();
- webkit_event.globalY = screen_point.y();
+ webkit_event.setPositionInScreen(screen_point.x(), screen_point.y());
return webkit_event;
}

Powered by Google App Engine
This is Rietveld 408576698