diff --git a/lib/network/modules/components/Edge.js b/lib/network/modules/components/Edge.js index b94b0752..3e29041e 100644 --- a/lib/network/modules/components/Edge.js +++ b/lib/network/modules/components/Edge.js @@ -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) { @@ -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 { @@ -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); } } }