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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 218883005: Fix another inappropriate overscroll glow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed complier error Created 6 years, 9 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 | « no previous file | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 21018cda889305f1ac26b69ff19bc7e4c29f63db..3966f502a614849155dac0af7bf549ee2277c112 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -2269,6 +2269,15 @@ bool LayerTreeHostImpl::ScrollBy(const gfx::Point& viewport_point,
applied_delta = ScrollLayerWithLocalDelta(layer_impl, pending_delta);
}
+ 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);
+ }
+
// If the layer wasn't able to move, try the next one in the hierarchy.
float move_threshold = 0.1f;
bool did_move_layer_x = std::abs(applied_delta.x()) > move_threshold;
@@ -2284,15 +2293,6 @@ bool LayerTreeHostImpl::ScrollBy(const gfx::Point& viewport_point,
break;
}
- 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_) {
active_tree_->SetCurrentlyScrollingLayer(layer_impl);
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698