google-code-export / jsplumb

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

sourceAnchor undefined #325

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

Hello,

v1.4 from master raises an exception in L8563 (jquery.jsplumb-all), due to an 
undefined variable "sourceAnchor".

lineCalculators = {
                    oppositex : function() {
                        with (paintInfo) {        
                        // WORKS ALWAYS
                            if (params.sourceEndpoint.elementId == params.targetEndpoint.elementId) {
                                var _y = startStubY + ((1 - sourceAnchor.y) * sourceInfo.height) + _super.maxStub;
                                return [ [ startStubX, _y ], [ endStubX, _y ]];
                            }                                                        
                            else if (!isXGreaterThanStubTimes2 || (so[0] == 1 && startStubX > endStubX)
                               || (so[0] == -1 && startStubX < endStubX)) {
                                return [[ startStubX, midy ], [ endStubX, midy ]];                                            
                            }
                            else if ((so[0] == 1 && startStubX < endStubX) || (so[0] == -1 && startStubX > endStubX)) {
                                return [[ midx, sy ], [ midx, ty ]];
                            }
                        }
                    }

Original issue reported on code.google.com by pedr...@gmail.com on 28 Feb 2013 at 10:05

GoogleCodeExporter commented 9 years ago
It seems sourceInfo also is undefined

Original comment by pedr...@gmail.com on 28 Feb 2013 at 10:13

GoogleCodeExporter commented 9 years ago
it seems the following change fixes it:
var _y = startStubY + ((1 - params.sourceAnchor.y) * 
params.sourceEndpoint.element.height()) + _super.maxStub;

Original comment by pedr...@gmail.com on 28 Feb 2013 at 10:19

GoogleCodeExporter commented 9 years ago
i cant apply a fix that uses a jquery function here.  

Original comment by simon.po...@gmail.com on 28 Feb 2013 at 10:22

GoogleCodeExporter commented 9 years ago
fixed

Original comment by simon.po...@gmail.com on 28 Feb 2013 at 10:30