-
-
Notifications
You must be signed in to change notification settings - Fork 980
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
Conversation
apple/Handlers/RNFlingHandler.m
Outdated
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; | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this 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)
Those comments require response from @j-piasecki, so I believe he will address them when reviewing this PR 😅 |
This reverts commit e09f18e.
…react-native-gesture-handler into @mbert/add-fling-macos
Description
This PR adds
FlingGestureHandler
onmacOS
. From now, all handlers, exceptForceTouchGestureHandler
, are available on this platform 🥳Test plan
Tested on newly added example.