Skip to content

Commit 919c89e

Browse files
committed
Stay in layer scroll if nothing to scroll
Bug: 6628376 The issue here is that contentX & contentY can both be 0 if we are scrolling slowly enough as they are adjusted by the page's scale and can thus round down. However, this would result in us falling out of layer drag mode even though we haven't tried to scroll past the edge of the layer. Detect this case, and stay in layer scroll mode. Change-Id: I3c655d0d03e8f89887abbe718bd24699c133ee1a
1 parent 4c38fe3 commit 919c89e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

core/java/android/webkit/WebViewClassic.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6224,8 +6224,9 @@ private boolean doDrag(int deltaX, int deltaY) {
62246224
final int resultY = Math.max(0,
62256225
Math.min(mScrollingLayerRect.top + contentY, maxY));
62266226

6227-
if (resultX != mScrollingLayerRect.left ||
6228-
resultY != mScrollingLayerRect.top) {
6227+
if (resultX != mScrollingLayerRect.left
6228+
|| resultY != mScrollingLayerRect.top
6229+
|| (contentX | contentY) == 0) {
62296230
// In case we switched to dragging the page.
62306231
mTouchMode = TOUCH_DRAG_LAYER_MODE;
62316232
deltaX = contentX;

0 commit comments

Comments
 (0)