How to animate movement of a single point of a Line or a Polygon? #2951
Unanswered
adil-tanveer888
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to know how I can animate the movement of a single point of a Line or a Polygon as the user drags them on the screen. I am using Reanimated shared values, React native Gesture handler and Skia Line, Skia Path for polygons.
Here is the sample code that I am trying to implement:
How can I move just one point of the line? I am capturing the amount translated but it seems I cannot use shared values in the line component. I can use matrix to translate the whole line but I just want one point to be moved as the user drags that point.
Extending on this would be to move just one point of an n-sided polygon. I am currently using Skia Path for the polygon. How can I animate the movement of any point of the Skia Path an arbitrary distance based on the pan gesture by the user?
Beta Was this translation helpful? Give feedback.
All reactions