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

[macOS] Add FlingGestureHandler #3028

Merged
merged 27 commits into from
Aug 23, 2024
Merged

[macOS] Add FlingGestureHandler #3028

merged 27 commits into from
Aug 23, 2024

Conversation

m-bert
Copy link
Contributor

@m-bert m-bert commented Aug 5, 2024

Description

This PR adds FlingGestureHandler on macOS. From now, all handlers, exceptForceTouchGestureHandler, are available on this platform 🥳

Test plan

Tested on newly added example.

@m-bert m-bert marked this pull request as ready for review August 14, 2024 13:04
apple/RNGHVector.h Outdated Show resolved Hide resolved
apple/RNGHVector.h Outdated Show resolved Hide resolved
apple/Handlers/RNFlingHandler.m Outdated Show resolved Hide resolved
apple/Handlers/RNFlingHandler.m Outdated Show resolved Hide resolved
apple/Handlers/RNFlingHandler.m Show resolved Hide resolved
apple/RNGestureHandlerDirection.h Outdated Show resolved Hide resolved
apple/RNGestureHandlerDirection.h Outdated Show resolved Hide resolved
apple/RNGHVector.m Show resolved Hide resolved
apple/RNGHVector.m Outdated Show resolved Hide resolved
Comment on lines 195 to 213
for (int i = 0; i < directionsSize; ++i) {
if ([self getAlignment:diagonalDirections[i]
withMinimalAlignmentCosine:diagonalDeviationCosine
withVelocityVector:velocityVector]) {
isAligned = YES;
break;
}
}

if (!isAligned) {
for (int i = 0; i < directionsSize; ++i) {
if ([self getAlignment:axialDirections[i]
withMinimalAlignmentCosine:axialDeviationCosine
withVelocityVector:velocityVector]) {
isAligned = YES;
break;
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Just an opinion, but I think it'd be preferable to check axialDirections first.

They are more likely to occur and these iterations are not all that cheap

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, done in 6406cd0

Copy link
Contributor

@latekvo latekvo left a comment

Choose a reason for hiding this comment

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

Looking good, just make sure these are resolved before merging:
#3028 (comment)
#3028 (comment)

@m-bert
Copy link
Contributor Author

m-bert commented Aug 21, 2024

Looking good, just make sure these are resolved before merging:

Those comments require response from @j-piasecki, so I believe he will address them when reviewing this PR 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants