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

Unified Diff: cc/layers/layer_impl.cc

Issue 626403003: Respect user_scrollable disabling in pinch-virtual-viewport mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 2 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 | « cc/layers/layer_impl.h ('k') | cc/layers/layer_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer_impl.cc
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index 302bda43088490d68f4f303404197e44d5cc0995..9e3779f3162a89ec8a10f0627da1d091204031c3 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -365,11 +365,18 @@ void LayerImpl::SetSentScrollDelta(const gfx::Vector2dF& sent_scroll_delta) {
}
gfx::Vector2dF LayerImpl::ScrollBy(const gfx::Vector2dF& scroll) {
+ gfx::Vector2dF adjusted_scroll = scroll;
+ if (layer_tree_impl()->settings().use_pinch_virtual_viewport) {
+ if (!user_scrollable_horizontal_)
+ adjusted_scroll.set_x(0);
+ if (!user_scrollable_vertical_)
+ adjusted_scroll.set_y(0);
+ }
DCHECK(scrollable());
gfx::Vector2dF min_delta = -ScrollOffsetToVector2dF(scroll_offset_);
gfx::Vector2dF max_delta = MaxScrollOffset().DeltaFrom(scroll_offset_);
// Clamp new_delta so that position + delta stays within scroll bounds.
- gfx::Vector2dF new_delta = (ScrollDelta() + scroll);
+ gfx::Vector2dF new_delta = (ScrollDelta() + adjusted_scroll);
new_delta.SetToMax(min_delta);
new_delta.SetToMin(max_delta);
gfx::Vector2dF unscrolled =
« no previous file with comments | « cc/layers/layer_impl.h ('k') | cc/layers/layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698