As you can see, I’m trying to make two circles and one line. When u click on the first cirle u can modify the line position.
I have 2 questions:
- How to remove the second line? (The second line swhow up only when I add the second circle.)
- How to stop the “animation” after
mouseupevent?
You only begin one path, hence the line between the two circles, and
startwill always be true in thatifstatement – you should put that inside themousemovelistener, and only attach it once.This creates an arc:
And then, this creates an arc on the same path, so there’ll be a line from the last one’s end to this one’s start:
Instead, just put them in separate paths:
Here’s the updated jsFiddle.