Closed Bug 855783 Opened 12 years ago Closed 12 years ago

Map gamepad right joystick to zooming

Categories

(Firefox for Android Graveyard :: Toolbar, defect)

All
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 22

People

(Reporter: kats, Assigned: kats)

References

Details

Attachments

(2 files)

Attached patch Part 1 - s/autoscroll/autonav/ (deleted) — Splinter Review
No description provided.
Attachment #730779 - Flags: review?(chrislord.net)
By lumping this into the same animation runnable as the autoscroll stuff, we can do both simultaneously. e.g. while panning down a long page you can zoom in and out and not interrupt the panning.
Attachment #730780 - Flags: review?(chrislord.net)
Comment on attachment 730779 [details] [diff] [review] Part 1 - s/autoscroll/autonav/ Review of attachment 730779 [details] [diff] [review]: ----------------------------------------------------------------- LGTM.
Attachment #730779 - Flags: review?(chrislord.net) → review+
Comment on attachment 730780 [details] [diff] [review] Part 2 - Adjust zoom on gamepad's right joystick's y-axis Review of attachment 730780 [details] [diff] [review]: ----------------------------------------------------------------- Nice! Now let's file a bug to get acceleration on analog stick movement :) ::: mobile/android/base/gfx/JavaPanZoomController.java @@ +521,5 @@ > + return filterDeadZone(value, range) * MAX_SCROLL; > + } > + > + private float normalizeJoystickZoom(float value, InputDevice.MotionRange range) { > + return filterDeadZone(value, range) * -MAX_ZOOM_DELTA; Add a comment that you're negating this value so that pushing up on the right stick zooms in instead of out (I assume that's why this is?) @@ +1054,5 @@ > + private ImmutableViewportMetrics applyZoomDelta(ImmutableViewportMetrics metrics, float zoomDelta) { > + float oldZoom = metrics.zoomFactor; > + float newZoom = oldZoom + zoomDelta; > + float adjustedZoom = getAdjustedZoomFactor(newZoom / oldZoom); > + PointF center = new PointF(metrics.getWidth() / 2.0f, metrics.getHeight() / 2.0f); A comment here to the effect that lacking a focus, always zoom to the center? No biggie.
Attachment #730780 - Flags: review?(chrislord.net) → review+
(In reply to Chris Lord [:cwiiis] from comment #3) > Nice! Now let's file a bug to get acceleration on analog stick movement :) Filed bug 855857. > Add a comment that you're negating this value so that pushing up on the > right stick zooms in instead of out (I assume that's why this is?) Yup. Comment added. > A comment here to the effect that lacking a focus, always zoom to the > center? No biggie. Comment added. https://hg.mozilla.org/integration/mozilla-inbound/rev/d09726c2fa50 https://hg.mozilla.org/integration/mozilla-inbound/rev/29c3bf1d142e
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 22
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: