examples/scroll: touch release does not start inertial scrolling
Ebitengine Version
main (ab841bf203427e7d8208598f58285b686bcfc45a)
Operating System
- Windows
- macOS
- Linux
- FreeBSD
- OpenBSD
- Android
- iOS
- Nintendo Switch
- PlayStation 5
- Xbox
- Web Browsers
Go Version (paste your go version output)
go version go1.27.1 linux/amd64
What steps will reproduce the problem?
Run examples/scroll on a touch-capable device, or inject touch input through exp/vmhost. Press at (100,180), move to Y=160,140,120 over successive ticks, then release. Compare the content immediately after release and one tick later.
What is the expected result?
The content continues scrolling with the last drag velocity, as it does for mouse dragging. A stationary tap should not start scrolling.
What happens instead?
The content stops when the touch is released. isPointingDeviceJustReleased returns false when justReleasedTouchIDs is nonempty. Simply returning true is insufficient: the released touch is no longer available and pointingDevicePosition switches to the mouse cursor.
Anything else you feel useful to add?
Reproduced with desktop VM touch injection under Linux/Xvfb on main ab841bf203. The proposed fix tracks velocity while dragging and resets the position baseline when a drag starts. Native mobile devices have not been tested.
Source: hajimehoshi/ebiten