|
@ -127,9 +127,9 @@ class Label { |
|
|
// configure context for drawing the text
|
|
|
// configure context for drawing the text
|
|
|
ctx.font = (selected && this.nodeOptions.labelHighlightBold ? 'bold ' : '') + fontSize + "px " + this.fontOptions.face; |
|
|
ctx.font = (selected && this.nodeOptions.labelHighlightBold ? 'bold ' : '') + fontSize + "px " + this.fontOptions.face; |
|
|
ctx.fillStyle = fontColor; |
|
|
ctx.fillStyle = fontColor; |
|
|
// When the shape is a box and the textAlign property is 'left', make label left-justified
|
|
|
|
|
|
if (this.options.shape === 'box' && this.options.font.textAlign === 'left') { |
|
|
|
|
|
ctx.textAlign = 'left'; |
|
|
|
|
|
|
|
|
// When the textAlign property is 'left', make label left-justified
|
|
|
|
|
|
if (this.options.font.textAlign === 'left') { |
|
|
|
|
|
ctx.textAlign = this.options.font.textAlign; |
|
|
x = x - (this.size.wideth >> 1); // Shift label 1/2-way (>>1 == div by 2) left
|
|
|
x = x - (this.size.wideth >> 1); // Shift label 1/2-way (>>1 == div by 2) left
|
|
|
} else { |
|
|
} else { |
|
|
ctx.textAlign = 'center'; |
|
|
ctx.textAlign = 'center'; |
|
|