Index: cc/trees/layer_tree_host_impl.cc |
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc |
index 958419eb306af5bcd1bc1b8a0b022095b9941ee5..f320b761d008320e4658f8d1be0777067fcc2014 100644 |
--- a/cc/trees/layer_tree_host_impl.cc |
+++ b/cc/trees/layer_tree_host_impl.cc |
@@ -2272,8 +2272,14 @@ bool LayerTreeHostImpl::ScrollBy(const gfx::Point& viewport_point, |
break; |
} |
- if (layer_impl == InnerViewportScrollLayer()) |
+ if (layer_impl == InnerViewportScrollLayer()) { |
unused_root_delta.Subtract(applied_delta); |
+ const float kOverscrollEpsilon = 0.01f; |
+ if (std::abs(unused_root_delta.x()) < kOverscrollEpsilon) |
+ unused_root_delta.set_x(0.0f); |
+ if (std::abs(unused_root_delta.y()) < kOverscrollEpsilon) |
+ unused_root_delta.set_y(0.0f); |
+ } |
did_lock_scrolling_layer_ = true; |
if (!should_bubble_scrolls_) { |
@@ -2314,7 +2320,7 @@ bool LayerTreeHostImpl::ScrollBy(const gfx::Point& viewport_point, |
accumulated_root_overscroll_.set_y(0); |
accumulated_root_overscroll_ += unused_root_delta; |
- bool did_overscroll = !gfx::ToRoundedVector2d(unused_root_delta).IsZero(); |
+ bool did_overscroll = !unused_root_delta.IsZero(); |
if (did_overscroll && input_handler_client_) { |
DidOverscrollParams params; |
params.accumulated_overscroll = accumulated_root_overscroll_; |