|
@ -528,10 +528,9 @@ class Edge { |
|
|
// set style
|
|
|
// set style
|
|
|
var node1 = this.from; |
|
|
var node1 = this.from; |
|
|
var node2 = this.to; |
|
|
var node2 = this.to; |
|
|
var selected = (this.from.selected || this.to.selected || this.selected); |
|
|
|
|
|
|
|
|
|
|
|
if (this.labelModule.differentState(selected, this.hover)) { |
|
|
|
|
|
this.labelModule.getTextSize(ctx, selected, this.hover); |
|
|
|
|
|
|
|
|
if (this.labelModule.differentState(this.selected, this.hover)) { |
|
|
|
|
|
this.labelModule.getTextSize(ctx, this.selected, this.hover); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (node1.id != node2.id) { |
|
|
if (node1.id != node2.id) { |
|
@ -541,13 +540,13 @@ class Edge { |
|
|
|
|
|
|
|
|
// if the label has to be rotated:
|
|
|
// if the label has to be rotated:
|
|
|
if (this.options.font.align !== "horizontal") { |
|
|
if (this.options.font.align !== "horizontal") { |
|
|
this.labelModule.calculateLabelSize(ctx, selected, this.hover, point.x, point.y); |
|
|
|
|
|
|
|
|
this.labelModule.calculateLabelSize(ctx, this.selected, this.hover, point.x, point.y); |
|
|
ctx.translate(point.x, this.labelModule.size.yLine); |
|
|
ctx.translate(point.x, this.labelModule.size.yLine); |
|
|
this._rotateForLabelAlignment(ctx); |
|
|
this._rotateForLabelAlignment(ctx); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// draw the label
|
|
|
// draw the label
|
|
|
this.labelModule.draw(ctx, point.x, point.y, selected, this.hover); |
|
|
|
|
|
|
|
|
this.labelModule.draw(ctx, point.x, point.y, this.selected, this.hover); |
|
|
ctx.restore(); |
|
|
ctx.restore(); |
|
|
} |
|
|
} |
|
|
else { |
|
|
else { |
|
@ -564,7 +563,7 @@ class Edge { |
|
|
y = node1.y - node1.shape.height * 0.5; |
|
|
y = node1.y - node1.shape.height * 0.5; |
|
|
} |
|
|
} |
|
|
point = this._pointOnCircle(x, y, radius, 0.125); |
|
|
point = this._pointOnCircle(x, y, radius, 0.125); |
|
|
this.labelModule.draw(ctx, point.x, point.y, selected, this.hover); |
|
|
|
|
|
|
|
|
this.labelModule.draw(ctx, point.x, point.y, this.selected, this.hover); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|