Hareeshchandera / jsplumb

Automatically exported from code.google.com/p/jsplumb
0 stars 0 forks source link

Location of connections to an endpoint using 'dynamicAnchors' only updates for the first connection #119

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
When making multiple connections to an endpoint using dynamic anchors, only one 
connection (the first) seems to be in control of the dynamic anchor that is 
being used. When this connection causes the dynamic anchor to be repositioned, 
other connections don't update their position accordingly. See 
http://jsfiddle.net/jhfhB/1/ for a demo.

- when you move 'B', the endpoint moves between dynamic anchors; however, the 
connection between 'C' and 'A' stays put.
- when you move 'C', the endpoint on 'A' does not move. Unless 'B' has been 
moved first (and caused the endpoint to shift to another dynamic anchor); in 
that case, the connection will redraw to use the current location of the 
endpoint first.

Original issue reported on code.google.com by paul.uit...@gmail.com on 9 Aug 2011 at 9:27

GoogleCodeExporter commented 8 years ago
thanks for that.

i've updated the code and uploaded a cut of 1.3.2 to my server, and forked that 
jsfiddle you supplied:

http://jsfiddle.net/sporritt/Fc9Xa/

there were actually two bugs here: first, a target endpoint that was dynamic 
was not informing the rest of its connections they should repaint (what 
happened when you dragged B around), and secondly, when you dragged C, the code 
that calculated the dynamic anchor position on A was always computing itself 
with respect to B, and ignoring C, because B happened to be the _first_ 
connection that was made to A.  now the code tries to defer to the element that 
is being dragged when it computes its most appropriate position.

once i do the hide/show stuff then i will release 1.3.2 with all these recent 
fixes in.

Original comment by simon.po...@gmail.com on 9 Aug 2011 at 10:30

GoogleCodeExporter commented 8 years ago
Alright, that's very fast :) (although the fiddle you link to still has the 
1.3.1 version). Thanks for the help!

Original comment by paul.uit...@gmail.com on 10 Aug 2011 at 8:15

GoogleCodeExporter commented 8 years ago
omg do you know how often i do that on jsfiddle.

http://jsfiddle.net/sporritt/Fc9Xa/2/

try that one instead.

Original comment by simon.po...@gmail.com on 10 Aug 2011 at 8:21

GoogleCodeExporter commented 8 years ago
Nice, this works like a charm! Feels very natural now, how you can influence 
the location of the dynamic anchor by dragging connected elements around.

Original comment by paul.uit...@gmail.com on 10 Aug 2011 at 9:54

GoogleCodeExporter commented 8 years ago
great! marking fixed; releasing 1.3.2 in about 10 minutes.

Original comment by simon.po...@gmail.com on 11 Aug 2011 at 12:03

GoogleCodeExporter commented 8 years ago

Original comment by simon.po...@gmail.com on 11 Aug 2011 at 3:41