Skip to content

Conversation

@elijah-semyonov
Copy link

@elijah-semyonov elijah-semyonov commented Sep 27, 2023

Proposed Changes

Ignore unpressed events during velocity calculation on iOS.

Testing

Test: check that no unintended fling happens during drag-and-stop sequences

@igordmn igordmn force-pushed the igor.demin/revert-hitpathtracker branch from 56bebb9 to 53cfaab Compare September 27, 2023 18:03
Base automatically changed from igor.demin/revert-hitpathtracker to jb-main September 27, 2023 18:03
@elijah-semyonov elijah-semyonov force-pushed the es/fix-velocity-calculation branch from c10d9e0 to c2c6176 Compare October 12, 2023 11:17
This reverts commit c2c6176.
@elijah-semyonov elijah-semyonov self-assigned this Oct 12, 2023
@elijah-semyonov elijah-semyonov marked this pull request as ready for review October 12, 2023 11:27
/**
* Some platforms (e.g. iOS) velocity calculation is incorrect when end position is used in velocity calculation.
*/
internal expect val onlyPressedEventsForVelocityTracker: Boolean
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: hide such details in ios-actual and use something like:

internal expect fun VelocityTracker.shouldUse(event: PointerInputChange)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good.

@elijah-semyonov elijah-semyonov merged commit e1e5a87 into jb-main Oct 12, 2023
@elijah-semyonov elijah-semyonov deleted the es/fix-velocity-calculation branch October 12, 2023 16:21
igordmn pushed a commit that referenced this pull request Nov 15, 2023
igordmn pushed a commit that referenced this pull request Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants