Skip to content

feat(core): skip pinch zoom inertia on touch input#10329

Draft
charlieforward9 wants to merge 2 commits into
visgl:masterfrom
NEW-HEAT:codex/touch-pinch-inertia-damping
Draft

feat(core): skip pinch zoom inertia on touch input#10329
charlieforward9 wants to merge 2 commits into
visgl:masterfrom
NEW-HEAT:codex/touch-pinch-inertia-damping

Conversation

@charlieforward9

@charlieforward9 charlieforward9 commented May 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

Stops touch pinch gestures from applying the existing pinch-end inertia projection on final finger lift.

Why

Touch pinchend frequently 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

  • Detect touch pinch end via pointerType === 'touch'.
  • Skip the inertia branch only for touch pinch end.
  • Preserve existing mouse/trackpad pinch inertia.
  • Avoid new damping constants or projection math.

Validation

  • Added 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.

@coveralls

coveralls commented May 22, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 83.395% (+0.005%) from 83.39% — NEW-HEAT:codex/touch-pinch-inertia-damping into visgl:master

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.
@charlieforward9 charlieforward9 force-pushed the codex/touch-pinch-inertia-damping branch from 0dd35c6 to 7788e41 Compare May 23, 2026 09:43
@charlieforward9 charlieforward9 changed the title feat(core): tame pinch zoom inertia on touch lift feat(core): skip pinch zoom inertia on touch input May 23, 2026
@charlieforward9 charlieforward9 marked this pull request as draft June 11, 2026 03:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants