|
|
@ -878,7 +878,7 @@ Node.prototype._label = function (ctx, text, x, y, align, baseline, labelUnderNo |
|
|
|
|
|
|
|
var lines = text.split('\n'); |
|
|
|
var lineCount = lines.length; |
|
|
|
var fontSize = (Number(this.options.fontSize) + 4); |
|
|
|
var fontSize = (Number(this.options.fontSize) + 4); // TODO: why is this +4 ?
|
|
|
|
var yLine = y + (1 - lineCount) / 2 * fontSize; |
|
|
|
if (labelUnderNode == true) { |
|
|
|
yLine = y + (1 - lineCount) / (2 * fontSize); |
|
|
@ -893,7 +893,7 @@ Node.prototype._label = function (ctx, text, x, y, align, baseline, labelUnderNo |
|
|
|
var height = this.options.fontSize * lineCount; |
|
|
|
var left = x - width / 2; |
|
|
|
var top = y - height / 2; |
|
|
|
if (ctx.textBaseline == "top") { |
|
|
|
if (baseline == "top") { |
|
|
|
top += 0.5 * fontSize; |
|
|
|
} |
|
|
|
this.labelDimensions = {top:top,left:left,width:width,height:height,yLine:yLine}; |
|
|
|