From a53bcd8efa9c5d825f0b882a5f95f162d5e5cae1 Mon Sep 17 00:00:00 2001 From: killerDJO Date: Sat, 23 May 2015 12:20:18 +0300 Subject: [PATCH] fixed colors for selected and hover states --- lib/network/modules/components/edges/util/EdgeBase.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/network/modules/components/edges/util/EdgeBase.js b/lib/network/modules/components/edges/util/EdgeBase.js index a4962c08..dd2f9d2e 100644 --- a/lib/network/modules/components/edges/util/EdgeBase.js +++ b/lib/network/modules/components/edges/util/EdgeBase.js @@ -33,7 +33,7 @@ class EdgeBase { */ drawLine(ctx, selected, hover) { // set style - ctx.strokeStyle = this.getColor(ctx); + ctx.strokeStyle = this.getColor(ctx, selected, hover); ctx.lineWidth = this.getLineWidth(selected, hover); let via = undefined; if (this.options.dashes !== false) { @@ -256,7 +256,7 @@ class EdgeBase { } - getColor(ctx) { + getColor(ctx, selected, hover) { let colorOptions = this.options.color; if (colorOptions.inherit !== false) { // when this is a loop edge, just use the 'from' method @@ -306,10 +306,10 @@ class EdgeBase { this.colorDirty = false; - if (this.selected === true) { + if (selected === true) { return this.color.highlight; } - else if (this.hover === true) { + else if (hover === true) { return this.color.hover; } else { @@ -409,7 +409,7 @@ class EdgeBase { */ drawArrowHead(ctx, position, viaNode, selected, hover) { // set style - ctx.strokeStyle = this.getColor(ctx); + ctx.strokeStyle = this.getColor(ctx, selected, hover); ctx.fillStyle = ctx.strokeStyle; ctx.lineWidth = this.getLineWidth(selected, hover);