feat(core): skip pinch zoom inertia on touch input#10329
Draft
charlieforward9 wants to merge 2 commits into
Draft
feat(core): skip pinch zoom inertia on touch input#10329charlieforward9 wants to merge 2 commits into
charlieforward9 wants to merge 2 commits into
Conversation
4567349 to
0dd35c6
Compare
The pinch-end inertia projection is driven by velocity = Δlog2(scale)/Δt between the last two frames. On touch, the final-lift frame is almost always noisy, so even a small synthetic velocity gets multiplied by `inertia` and flings the camera well past where the user expected it to land. Gate the inertia branch on `pointerType !== 'touch'`. Trackpad / mouse pinches keep the existing inertia behavior; touch pinches end at the last live zoom. No new constants, no damping math — just one guard.
0dd35c6 to
7788e41
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stops touch pinch gestures from applying the existing pinch-end inertia projection on final finger lift.
Why
Touch
pinchendfrequently carries a noisy final scale delta as fingers leave the screen. The current inertia path turns that last-frame delta into a projected velocity, which can fling the camera beyond the user’s actual gesture. Trackpad and mouse pinch input do not show the same lift-frame noise.Change
pointerType === 'touch'.Validation
MapController skips pinch zoom inertia on touch lift, covering a 100x final-frame scale spike and asserting the final zoom stays at the last live pinch zoom.Merge Notes
Independent split from #10303. Complements #10328, which smooths noisy live pinch frames before this pinch-end path runs.