Chromium Code Reviews| Index: content/browser/renderer_host/input/touch_event_queue.cc |
| diff --git a/content/browser/renderer_host/input/touch_event_queue.cc b/content/browser/renderer_host/input/touch_event_queue.cc |
| index c863d299a5e27c467cd120e0190849a4bfac62ed..a6d8729f49c23f8df07303ebe487928a28d8cbb8 100644 |
| --- a/content/browser/renderer_host/input/touch_event_queue.cc |
| +++ b/content/browser/renderer_host/input/touch_event_queue.cc |
| @@ -169,17 +169,15 @@ class TouchEventQueue::TouchTimeoutHandler { |
| // a given slop region, unless the touchstart is preventDefault'ed. |
| class TouchEventQueue::TouchMoveSlopSuppressor { |
| public: |
| - // TODO(jdduke): Remove int cast on suppression length, crbug.com/336807. |
| TouchMoveSlopSuppressor(double slop_suppression_length_dips) |
| - : slop_suppression_length_dips_squared_( |
| - static_cast<int>(slop_suppression_length_dips) * |
| - static_cast<int>(slop_suppression_length_dips)), |
| + : slop_suppression_length_dips_squared_(slop_suppression_length_dips * |
| + slop_suppression_length_dips), |
| suppressing_touch_moves_(false) {} |
| bool FilterEvent(const WebTouchEvent& event) { |
| if (WebTouchEventTraits::IsTouchSequenceStart(event)) { |
| touch_sequence_start_position_ = |
|
jdduke (slow)
2014/03/10 22:03:23
Hmm, does this fit on one line now?
tdresser
2014/03/12 13:54:40
Yup, done.
|
| - gfx::PointF(event.touches[0].position.x, event.touches[0].position.y); |
| + gfx::PointF(event.touches[0].position); |
| suppressing_touch_moves_ = slop_suppression_length_dips_squared_ != 0; |
| } |
| @@ -192,11 +190,9 @@ class TouchEventQueue::TouchMoveSlopSuppressor { |
| suppressing_touch_moves_ = false; |
| } else if (event.touchesLength == 1) { |
| // Movement outside of the slop region should terminate suppression. |
| - // TODO(jdduke): Use strict inequality, crbug.com/336807. |
| - gfx::PointF position(event.touches[0].position.x, |
| - event.touches[0].position.y); |
| - if ((position - touch_sequence_start_position_).LengthSquared() >= |
| - slop_suppression_length_dips_squared_) |
| + gfx::PointF position(event.touches[0].position); |
| + if ((position - touch_sequence_start_position_).LengthSquared() > |
|
jdduke (slow)
2014/03/10 22:03:23
So, I'm wondering if we'll run into floating point
tdresser
2014/03/12 13:54:40
That's unfortunate. Good call though. Rounding bro
|
| + slop_suppression_length_dips_squared_) |
| suppressing_touch_moves_ = false; |
| } |
| } |