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

Drawn lines not dynamic? #21

Closed
ThirdGhostHand opened this issue Sep 5, 2018 · 2 comments
Closed

Drawn lines not dynamic? #21

ThirdGhostHand opened this issue Sep 5, 2018 · 2 comments

Comments

@ThirdGhostHand
Copy link

ThirdGhostHand commented Sep 5, 2018

I'm using a couple lines similar to this
<LineTo from="img" to="img2" borderColor="white" borderWidth={4} />
When rendered initially, the lines show up great, but if I move the images around say with animation or just by moving their relative position on screen by changing the size of the window, the lines stay where they were when first rendered, rather than following the images around. Am I doin' something wrong?

@kdeloach
Copy link
Owner

kdeloach commented Sep 6, 2018

This is by design. The line component is rendered relative to the window using absolute positioning. To update the line you need to trigger a render whenever the referenced objects change position.

Here's some reference code which does exactly this, from an earlier commit:

// Demonstrate how to draw a line between moving components.

@ThirdGhostHand
Copy link
Author

That seems to have fixed it right up! Thank you.

@kdeloach kdeloach closed this as completed Apr 2, 2019
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

No branches or pull requests

2 participants