diff --git a/examples/timeline/index.html b/examples/timeline/index.html index 9d2d8946..695c27a2 100644 --- a/examples/timeline/index.html +++ b/examples/timeline/index.html @@ -37,8 +37,10 @@

23_data_attributes.html

24_all_data_attributes.html

25_background_areas.html

-

26_templates.html

-

27_external_data.html

+

26_external_data.html

+

27_templates.html

+

29_hiding_times.html

+

30_subgroups.html

requirejs_example.html

diff --git a/lib/network/Node.js b/lib/network/Node.js index a1fe8704..e70ec7e1 100644 --- a/lib/network/Node.js +++ b/lib/network/Node.js @@ -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};