-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Get relative coords #2400
Get relative coords #2400
Conversation
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.
It doesn't convert cords - it measures and then converts cords relative to passed arguments. Can we avoid passing absolute x & y or not really?
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.
The current solution requires two calls of useAnimatedRef
and two calls of measure
. I think we can do it better. For example:
We can get the only ref to the current component, call the new version of measureWithParent - new implementation in JSI and calculate cords on the native side. What do you think?
|
Description
This pr introduces the
getRelativeCoords
function which enables to convert absolute coordinates to coordinates relative to the given view.Changes
getRelativeCoords
function