|
|
@ -8,17 +8,25 @@ class BezierEdgeDynamic extends BezierEdgeBase { |
|
|
|
|
|
|
|
setOptions(options) { |
|
|
|
this.options = options; |
|
|
|
this.from = this.body.nodes[this.options.from]; |
|
|
|
this.to = this.body.nodes[this.options.to]; |
|
|
|
this.id = this.options.id; |
|
|
|
this.setupSupportNode(); |
|
|
|
this.connect(); |
|
|
|
} |
|
|
|
|
|
|
|
// fix weird behaviour
|
|
|
|
if (this.from.id === this.to.id) { |
|
|
|
connect() { |
|
|
|
this.from = this.body.nodes[this.options.from]; |
|
|
|
this.to = this.body.nodes[this.options.to]; |
|
|
|
if (this.from === undefined || this.to === undefined) { |
|
|
|
this.via.setOptions({physics:false}) |
|
|
|
} |
|
|
|
else { |
|
|
|
this.via.setOptions({physics:true}) |
|
|
|
// fix weird behaviour where a selfreferencing node has physics enabled
|
|
|
|
if (this.from.id === this.to.id) { |
|
|
|
this.via.setOptions({physics: false}) |
|
|
|
} |
|
|
|
else { |
|
|
|
this.via.setOptions({physics: true}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|