-
Notifications
You must be signed in to change notification settings - Fork 63
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
Arrow #43
Comments
I would say not easily, because you would need the angle of the line to correctly point an arrowhead, and I don't think that angle is exposed by the API. It might not even be available because the lines are drawn between DOM elements using css, and I think those calculations are outside of the scope of the lib/javascript. |
So we are never getting arrows in this library? @stahlmanDesign |
A quick look in the source code makes me think it would be possible because the angles are calculated and saved in a variable. I once did this in a game using radians to get the angle of rotation based on a line. The character could shoot an arrow in the direction the mouse pointed (which was an invisible line from the character to the mouse pointer). The arrow was a sprite rotated to point in the direction it flew. Here we could either have a sprite (svg arrow tip) or draw a triangle in the saw way the line is drawn. If I ever have time this would be a fun challenge. |
I've been playing around with
react-lineto
and I really enjoy working with it. Thanks for putting this together!Is there a way to add an arrow to one or both ends of the line?
The text was updated successfully, but these errors were encountered: