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 685cfb99122f393eec5b610e90c35c8c51ed546d..e229474dff7c0181e362dbcce4ae6968ce355757 100644 |
--- a/cc/trees/layer_tree_host_impl.cc |
+++ b/cc/trees/layer_tree_host_impl.cc |
@@ -2313,6 +2313,13 @@ bool LayerTreeHostImpl::ScrollBy(const gfx::Point& viewport_point, |
unused_root_delta.set_x(0.0f); |
if (std::abs(unused_root_delta.y()) < kEpsilon) |
unused_root_delta.set_y(0.0f); |
+ // Disable overscroll on axes which is impossible to scroll. |
+ if (settings_.report_overscroll_only_for_scrollable_axes) { |
+ if (std::abs(active_tree_->TotalMaxScrollOffset().x()) <= kEpsilon) |
+ unused_root_delta.set_x(0.0f); |
+ if (std::abs(active_tree_->TotalMaxScrollOffset().y()) <= kEpsilon) |
+ unused_root_delta.set_y(0.0f); |
+ } |
} |
// If the layer wasn't able to move, try the next one in the hierarchy. |