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

Unified Diff: ui/events/android/motion_event_android.cc

Issue 2700623003: Make sure that the pressure is always 0 for pointerup events (Closed)
Patch Set: pointer pressure Created 3 years, 10 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/android/motion_event_android.cc
diff --git a/ui/events/android/motion_event_android.cc b/ui/events/android/motion_event_android.cc
index ee645bfc80e25d19e1596ce70994b404e7a33867..9815f2c69eff995fb32d546d23a74b96469beb64 100644
--- a/ui/events/android/motion_event_android.cc
+++ b/ui/events/android/motion_event_android.cc
@@ -304,6 +304,8 @@ float MotionEventAndroid::GetPressure(size_t pointer_index) const {
// accessed at most once per event instance).
if (!event_.obj())
return 0.f;
+ if (cached_action_ == ACTION_UP)
mustaq 2017/02/17 16:07:18 I guess this came from a previous mistake in Line
mustaq 2017/02/17 16:18:51 I have got the answer why we didn't hit Line 232 b
lanwei 2017/02/21 17:47:06 Acknowledged.
+ return 0.f;
return Java_MotionEvent_getPressureF_I(AttachCurrentThread(), event_,
pointer_index);
}

Powered by Google App Engine
This is Rietveld 408576698