Skip to content
This repository was archived by the owner on Jul 29, 2019. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions lib/network/modules/components/Edge.js
Original file line number Diff line number Diff line change
Expand Up @@ -528,10 +528,9 @@ class Edge {
// set style
var node1 = this.from;
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) {
Expand All @@ -541,13 +540,13 @@ class Edge {

// if the label has to be rotated:
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);
this._rotateForLabelAlignment(ctx);
}

// 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();
}
else {
Expand All @@ -564,7 +563,7 @@ class Edge {
y = node1.y - node1.shape.height * 0.5;
}
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);
}
}
}
Expand Down