Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c010924d authored by Huahui Wu's avatar Huahui Wu
Browse files

b/3348192 re-enable snap scrolling mode.

Change-Id: I19c9a2afdf28367f623bd9bd6b25e822a06a215c
parent e838a427
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -5570,6 +5570,24 @@ public class WebView extends AbsoluteLayout
                        break;
                    }

                    // Only lock dragging to one axis if we don't have a scale in progress.
                    // Scaling implies free-roaming movement. Note this is only ever a question
                    // if mZoomManager.supportsPanDuringZoom() is true.
                    final ScaleGestureDetector detector =
                      mZoomManager.getMultiTouchGestureDetector();
                    if (detector == null || !detector.isInProgress()) {
                        // if it starts nearly horizontal or vertical, enforce it
                        int ax = Math.abs(deltaX);
                        int ay = Math.abs(deltaY);
                        if (ax > MAX_SLOPE_FOR_DIAG * ay) {
                            mSnapScrollMode = SNAP_X;
                            mSnapPositive = deltaX > 0;
                        } else if (ay > MAX_SLOPE_FOR_DIAG * ax) {
                            mSnapScrollMode = SNAP_Y;
                            mSnapPositive = deltaY > 0;
                        }
                    }

                    mTouchMode = TOUCH_DRAG_MODE;
                    mLastTouchX = x;
                    mLastTouchY = y;