If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Overscroll resistance doesn't work anymore

VERIFIED FIXED

Status

()

Firefox for Android
General
VERIFIED FIXED
6 years ago
6 years ago

People

(Reporter: pcwalton, Assigned: pcwalton)

Tracking

({regression})

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
When the HTC Flyer fixes landed, they regressed overscroll resistance. A patch to reenable it is forthcoming.
(Assignee)

Comment 1

6 years ago
Created attachment 580300 [details] [diff] [review]
Proposed patch.

Proposed patch attached.

This patch also makes overscroll resistance work for pinch-to-zoom. This helps prevent users from zooming the page out to ridiculously small sizes.
Assignee: nobody → pwalton
Status: NEW → ASSIGNED
Attachment #580300 - Flags: review?(bugmail.mozilla)
Comment on attachment 580300 [details] [diff] [review]
Proposed patch.

> 
>-        float newZoomFactor = mController.getZoomFactor() *
>-                              (detector.getCurrentSpan() / detector.getPreviousSpan());
>+        float spanDifference = detector.getCurrentSpan() / detector.getPreviousSpan();
>+        float resistance = Math.min(mX.getEdgeResistance(), mY.getEdgeResistance());
>+        if (spanDifference > 1.0f)
>+            spanDifference = 1.0f + (spanDifference - 1.0f) * resistance;
>+        else
>+            spanDifference = 1.0f - (1.0f - spanDifference) * resistance;
>+
>+        float newZoomFactor = mController.getZoomFactor() * spanDifference;
> 
>         mController.scrollBy(new PointF(mLastZoomFocus.x - detector.getFocusX(),

Renaming spanDifference to spanRatio or something along those lines would make this code clearer. A comment to the effect that you're scaling it towards 1.0 would also be good.
Attachment #580300 - Flags: review?(bugmail.mozilla) → review+
(Assignee)

Comment 3

6 years ago
http://hg.mozilla.org/integration/mozilla-inbound/rev/c5f491145a27

Comment 4

6 years ago
https://hg.mozilla.org/mozilla-central/rev/c5f491145a27
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Verified fixed on Fennec Nightly 13.0a1 (2012-02-14)
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.