SIGN IN SIGN UP

Measure gesture inertia from the movement the gesture ended with (#8150)

* Measure gesture inertia from the movement the gesture ended with (#1303)

The release velocity was estimated as the sum of all pan deltas in the
inertia buffer divided by the time between the first and the last recorded
update. The first entry's delta accrued before its own timestamp, so the
numerator covered one interval more than the denominator, and the duration
ended at the last recorded update instead of at the release. Updates are
only recorded when the camera changes, so holding the pointer still records
nothing and the buffer shrinks from the front faster than the duration does,
which made a gesture held still before the release fling the map harder than
one released while still moving.

The velocity is now measured over the last 60 ms ending at the release, the
first entry contributes only its timestamp, and at least the last two entries
are always used so that inertia survives low frame rates. `_onMoveEnd` also
returns nothing when the measured interval holds no movement at all, which
terrain gestures can produce, and clears the buffer on its early-return paths.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Update the expected bundle size

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Trim comments and tests down to what the change needs

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Address review: tsdoc comments, CAPS constants, typed inertia buffer

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
M
Martin Ždila committed
2a940c1410196753b3152f5939b515ea5bba8748
Parent: 1246492
Committed by GitHub <noreply@github.com> on 8/12/2026, 9:15:03 AM