|
@ -33,7 +33,7 @@ class EdgeBase { |
|
|
*/ |
|
|
*/ |
|
|
drawLine(ctx, selected, hover) { |
|
|
drawLine(ctx, selected, hover) { |
|
|
// set style
|
|
|
// set style
|
|
|
ctx.strokeStyle = this.getColor(ctx); |
|
|
|
|
|
|
|
|
ctx.strokeStyle = this.getColor(ctx, selected, hover); |
|
|
ctx.lineWidth = this.getLineWidth(selected, hover); |
|
|
ctx.lineWidth = this.getLineWidth(selected, hover); |
|
|
let via = undefined; |
|
|
let via = undefined; |
|
|
if (this.options.dashes !== false) { |
|
|
if (this.options.dashes !== false) { |
|
@ -256,7 +256,7 @@ class EdgeBase { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getColor(ctx) { |
|
|
|
|
|
|
|
|
getColor(ctx, selected, hover) { |
|
|
let colorOptions = this.options.color; |
|
|
let colorOptions = this.options.color; |
|
|
if (colorOptions.inherit !== false) { |
|
|
if (colorOptions.inherit !== false) { |
|
|
// when this is a loop edge, just use the 'from' method
|
|
|
// when this is a loop edge, just use the 'from' method
|
|
@ -306,10 +306,10 @@ class EdgeBase { |
|
|
this.colorDirty = false; |
|
|
this.colorDirty = false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.selected === true) { |
|
|
|
|
|
|
|
|
if (selected === true) { |
|
|
return this.color.highlight; |
|
|
return this.color.highlight; |
|
|
} |
|
|
} |
|
|
else if (this.hover === true) { |
|
|
|
|
|
|
|
|
else if (hover === true) { |
|
|
return this.color.hover; |
|
|
return this.color.hover; |
|
|
} |
|
|
} |
|
|
else { |
|
|
else { |
|
@ -409,7 +409,7 @@ class EdgeBase { |
|
|
*/ |
|
|
*/ |
|
|
drawArrowHead(ctx, position, viaNode, selected, hover) { |
|
|
drawArrowHead(ctx, position, viaNode, selected, hover) { |
|
|
// set style
|
|
|
// set style
|
|
|
ctx.strokeStyle = this.getColor(ctx); |
|
|
|
|
|
|
|
|
ctx.strokeStyle = this.getColor(ctx, selected, hover); |
|
|
ctx.fillStyle = ctx.strokeStyle; |
|
|
ctx.fillStyle = ctx.strokeStyle; |
|
|
ctx.lineWidth = this.getLineWidth(selected, hover); |
|
|
ctx.lineWidth = this.getLineWidth(selected, hover); |
|
|
|
|
|
|
|
|