Skip to content

Add kinetic inertia for map pan and pinch-zoom gestures#7202

Merged
nirvn merged 4 commits intomasterfrom
kinetic-scroll
Apr 5, 2026
Merged

Add kinetic inertia for map pan and pinch-zoom gestures#7202
nirvn merged 4 commits intomasterfrom
kinetic-scroll

Conversation

@mohsenD98
Copy link
Copy Markdown
Collaborator

@mohsenD98 mohsenD98 commented Mar 25, 2026

🚀 Description

Add kinetic (inertia) scrolling to the map canvas for pan and pinch-zoom gestures.

Qt's pointer handlers report position but not velocity, so we sample finger positions over a sliding time window and compute release velocity ourselves. After the gesture ends, motion continues with exponential friction decay.

✨ Key Changes

  • New KineticScrollHandler QML component with velocity sampling
  • Any new touch or jumpTo() call immediately cancels the kinetic animation

Demo

Screen.Recording.2026-03-25.at.3.15.25.PM.mov

Todo

  • zoom

@mohsenD98 mohsenD98 self-assigned this Mar 25, 2026
@qfield-fairy
Copy link
Copy Markdown
Collaborator

qfield-fairy commented Mar 25, 2026

🍎 MacOS DMG universal builds

Download a MacOS DMG universal build of this PR for testing.
(Built from commit 97e764d)

🪟 Windows builds

Download a Windows build of this PR for testing.
(Built from commit 97e764d)

📱 Android builds

Download an Android arm64 build of this PR for testing.
(Built from commit 97e764d)

Other Android architectures

🐧 Linux AppImage builds

Download a Linux AppImage build of this PR for testing.
(Built from commit 97e764d)

@mohsenD98 mohsenD98 changed the title Add kinetic inertia for map pan and pinch-zoom gestures WIP Add kinetic inertia for map pan and pinch-zoom gestures Mar 25, 2026
@nirvn nirvn closed this Mar 27, 2026
@nirvn nirvn reopened this Mar 27, 2026
@mohsenD98 mohsenD98 marked this pull request as draft March 29, 2026 14:02
@mohsenD98 mohsenD98 closed this Mar 29, 2026
@mohsenD98 mohsenD98 reopened this Mar 29, 2026
@mohsenD98 mohsenD98 changed the title WIP Add kinetic inertia for map pan and pinch-zoom gestures Add kinetic inertia for map pan and pinch-zoom gestures Mar 29, 2026
@mohsenD98 mohsenD98 marked this pull request as ready for review March 29, 2026 17:37
Comment thread src/qml/MapCanvas.qml Outdated
Comment thread src/qml/KineticScrollHandler.qml Outdated
@mohsenD98 mohsenD98 marked this pull request as draft March 31, 2026 15:14
@mohsenD98 mohsenD98 marked this pull request as ready for review April 2, 2026 09:26
@nirvn nirvn force-pushed the kinetic-scroll branch 2 times, most recently from 6b2e251 to e3ee35a Compare April 5, 2026 08:52
Comment thread src/qml/MapCanvas.qml Outdated
@nirvn nirvn merged commit 6876486 into master Apr 5, 2026
26 checks passed
@nirvn nirvn deleted the kinetic-scroll branch April 5, 2026 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants