Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore unpressed events during velocity calculation on iOS #848

Merged
merged 6 commits into from Oct 12, 2023

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
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
3 checks passed
@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
Projects
None yet
2 participants