|
@ -40,7 +40,7 @@ class EdgeBase { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
else { |
|
|
else { |
|
|
let [x,y,radius] = this._getCircleData(); |
|
|
|
|
|
|
|
|
let [x,y,radius] = this._getCircleData(ctx); |
|
|
this._circle(ctx, x, y, radius); |
|
|
this._circle(ctx, x, y, radius); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -116,7 +116,7 @@ class EdgeBase { |
|
|
to = this._findBorderPosition(this.to, ctx); |
|
|
to = this._findBorderPosition(this.to, ctx); |
|
|
} |
|
|
} |
|
|
else { |
|
|
else { |
|
|
let [x,y,radius] = this._getCircleData(); |
|
|
|
|
|
|
|
|
let [x,y,radius] = this._getCircleData(ctx); |
|
|
|
|
|
|
|
|
from = this._findBorderPositionCircle(this.from, ctx, {x, y, low:0.25, high:0.6, direction:-1}); |
|
|
from = this._findBorderPositionCircle(this.from, ctx, {x, y, low:0.25, high:0.6, direction:-1}); |
|
|
to = this._findBorderPositionCircle(this.from, ctx, {x, y, low:0.6, high:0.8, direction:1}); |
|
|
to = this._findBorderPositionCircle(this.from, ctx, {x, y, low:0.6, high:0.8, direction:1}); |
|
@ -124,11 +124,17 @@ class EdgeBase { |
|
|
return {from, to}; |
|
|
return {from, to}; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
_getCircleData() { |
|
|
|
|
|
|
|
|
_getCircleData(ctx) { |
|
|
let x, y; |
|
|
let x, y; |
|
|
let node = this.from; |
|
|
let node = this.from; |
|
|
let radius = this.options.selfReferenceSize; |
|
|
let radius = this.options.selfReferenceSize; |
|
|
|
|
|
|
|
|
|
|
|
if (ctx !== undefined) { |
|
|
|
|
|
if (node.shape.width === undefined) { |
|
|
|
|
|
node.shape.resize(ctx); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// get circle coordinates
|
|
|
// get circle coordinates
|
|
|
if (node.shape.width > node.shape.height) { |
|
|
if (node.shape.width > node.shape.height) { |
|
|
x = node.x + node.shape.width * 0.5; |
|
|
x = node.x + node.shape.width * 0.5; |
|
@ -435,7 +441,7 @@ class EdgeBase { |
|
|
else { |
|
|
else { |
|
|
// draw circle
|
|
|
// draw circle
|
|
|
let angle, point; |
|
|
let angle, point; |
|
|
let [x,y,radius] = this._getCircleData(); |
|
|
|
|
|
|
|
|
let [x,y,radius] = this._getCircleData(ctx); |
|
|
|
|
|
|
|
|
if (position == 'from') { |
|
|
if (position == 'from') { |
|
|
point = this.findBorderPosition(this.from, ctx, {x, y, low:0.25, high:0.6, direction:-1}); |
|
|
point = this.findBorderPosition(this.from, ctx, {x, y, low:0.25, high:0.6, direction:-1}); |
|
|