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

Unified Diff: mojo/examples/sample_app/gles2_client_impl.cc

Issue 478523002: mojo events: Add |screen_location| to LocationData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix crash observed locally because of synthesized aura events. Created 6 years, 4 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
« no previous file with comments | « mojo/examples/pepper_container_app/pepper_container_app.cc ('k') | mojo/examples/sample_app/sample_app.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/examples/sample_app/gles2_client_impl.cc
diff --git a/mojo/examples/sample_app/gles2_client_impl.cc b/mojo/examples/sample_app/gles2_client_impl.cc
index fde074abba130c471ea37b0887773977b58dc17c..1723b16bddc279262659a4ad472d68f33ee561fa 100644
--- a/mojo/examples/sample_app/gles2_client_impl.cc
+++ b/mojo/examples/sample_app/gles2_client_impl.cc
@@ -55,7 +55,7 @@ void GLES2ClientImpl::HandleInputEvent(const mojo::Event& event) {
case mojo::EVENT_TYPE_TOUCH_PRESSED:
if (event.flags & mojo::EVENT_FLAGS_RIGHT_MOUSE_BUTTON)
break;
- capture_point_ = *event.location;
+ capture_point_ = *event.location_data->in_view_location;
last_drag_point_ = capture_point_;
drag_start_time_ = mojo::GetTimeTicksNow();
break;
@@ -63,16 +63,16 @@ void GLES2ClientImpl::HandleInputEvent(const mojo::Event& event) {
case mojo::EVENT_TYPE_TOUCH_MOVED: {
if (event.flags & mojo::EVENT_FLAGS_RIGHT_MOUSE_BUTTON)
break;
- int direction = event.location->y < last_drag_point_.y ||
- event.location->x > last_drag_point_.x
- ? 1
- : -1;
+ int direction =
+ (event.location_data->in_view_location->y < last_drag_point_.y ||
+ event.location_data->in_view_location->x > last_drag_point_.x)
+ ? 1 : -1;
cube_.set_direction(direction);
- cube_.UpdateForDragDistance(
- CalculateDragDistance(last_drag_point_, *event.location));
+ cube_.UpdateForDragDistance(CalculateDragDistance(
+ last_drag_point_, *event.location_data->in_view_location));
WantToDraw();
- last_drag_point_ = *event.location;
+ last_drag_point_ = *event.location_data->in_view_location;
break;
}
case mojo::EVENT_TYPE_MOUSE_RELEASED:
@@ -83,9 +83,8 @@ void GLES2ClientImpl::HandleInputEvent(const mojo::Event& event) {
}
MojoTimeTicks offset = mojo::GetTimeTicksNow() - drag_start_time_;
float delta = static_cast<float>(offset) / 1000000.;
- cube_.SetFlingMultiplier(
- CalculateDragDistance(capture_point_, *event.location),
- delta);
+ cube_.SetFlingMultiplier(CalculateDragDistance(
+ capture_point_, *event.location_data->in_view_location), delta);
capture_point_ = last_drag_point_ = mojo::Point();
WantToDraw();
« no previous file with comments | « mojo/examples/pepper_container_app/pepper_container_app.cc ('k') | mojo/examples/sample_app/sample_app.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698