saket / telephoto

Building blocks for designing media experiences in Compose UI
https://saket.github.io/telephoto/
Apache License 2.0
869 stars 28 forks source link

Incorrect fling velocity on zoom gesture end with Compose 1.7.0-alpha02 #71

Closed FooIbar closed 2 months ago

FooIbar commented 4 months ago

https://github.com/saket/telephoto/assets/118464521/746bc90b-0dbf-4889-b588-5beabd046894

[VelocityTrackerAddPointsFix](https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/util/package-summary#VelocityTrackerAddPointsFix()) is enabled by default since Compose UI 1.7.0-alpha02. Currently we set this flag to false as a workaround, but it will be removed in the future.

Related bug: https://issuetracker.google.com/269487059

FooIbar commented 3 months ago

I believe this is caused by https://github.com/saket/telephoto/blob/1749177719156efe8ed5a7ce8fa15b7f54778f8c/zoomable/src/commonMain/kotlin/me/saket/telephoto/zoomable/internal/transformable.kt#L197-L199 where changes from different pointers are added to the same VelocityTracker.