Closed Bug 708947 Opened 8 years ago Closed 8 years ago

Overscroll resistance doesn't work anymore

Categories

(Firefox for Android :: General, defect)

ARM
Android
defect
Not set

Tracking

()

VERIFIED FIXED

People

(Reporter: pcwalton, Assigned: pcwalton)

References

Details

(Keywords: regression)

Attachments

(1 file)

When the HTC Flyer fixes landed, they regressed overscroll resistance. A patch to reenable it is forthcoming.
Attached patch Proposed patch.Splinter Review
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+
https://hg.mozilla.org/mozilla-central/rev/c5f491145a27
Status: ASSIGNED → RESOLVED
Closed: 8 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.