Hareeshchandera / jsplumb

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

Bezier source endpoints using target's orientation when both set to Continuous (possible code fix included) #241

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Howdy,

First, thanks a ton for your work on this library. It's awesome.

Issue:
When both the source and target endpoint's anchors are continuous, and they're 
beziers, the source endpoint will use the target's orientation for horizontal 
and vertical joins. This leads to wacky connections like the "wonky" pic below.

Working example:
http://jsfiddle.net/rXCBq/2/

Fix:
On line 5582 of the full 1.3.8 source:

   _CP2 = self._findControlPoint([_tx,_ty], targetPos, sourcePos, sourceEndpoint, targetEndpoint, targetAnchor, sourceAnchor);                

Swapping 'sourceEndpoint' and 'targetEndpoint' around causes the beziers to 
draw properly, as in the "fixed" pic below.

It's terribly late so I haven't tested whether this borks anything else. :/

Original issue reported on code.google.com by xhva....@gmail.com on 16 May 2012 at 4:02

Attachments:

GoogleCodeExporter commented 8 years ago
thanks for the fix - i'll take a look and see how it plays with the other 
anchor types. at first glance it looks like that change might break in other 
anchor types. but i'll check it out.  it could be that i should just make the 
source endpoint use its own orientation!

Original comment by simon.po...@gmail.com on 17 May 2012 at 8:47

GoogleCodeExporter commented 8 years ago
ok just looked at this...i think the code you supplied fixes a bug that's been 
in there for a while, but which has only manifested itself since continuous 
anchors have been around.

so, thanks!  targeting this for the 1.3.9 release.

Original comment by simon.po...@gmail.com on 22 May 2012 at 4:18