Browse Source

fixed multiline labels per #184

css_transitions
Alex de Mulder 10 years ago
parent
commit
17a6f6bb74
4 changed files with 6 additions and 5 deletions
  1. +1
    -0
      HISTORY.md
  2. +2
    -2
      dist/vis.js
  3. +2
    -2
      dist/vis.min.js
  4. +1
    -1
      src/graph/Node.js

+ 1
- 0
HISTORY.md View File

@ -21,6 +21,7 @@ http://visjs.org
- Added pull request from Vukk, user can now define the edge width multiplier when selected.
- Fixed graph.storePositions()
- Extended Selection API with selectNodes and selectEdges, deprecating setSelection.
- Fixed multiline labels.
### Graph3d

+ 2
- 2
dist/vis.js View File

@ -5,7 +5,7 @@
* A dynamic, browser-based visualization library.
*
* @version 2.0.1-SNAPSHOT
* @date 2014-06-24
* @date 2014-06-26
*
* @license
* Copyright (C) 2011-2014 Almende B.V, http://almende.com
@ -9795,7 +9795,7 @@ Node.prototype._label = function (ctx, text, x, y, align, baseline) {
var lines = text.split('\n'),
lineCount = lines.length,
fontSize = (this.fontSize + 4),
yLine = y + (1 - lineCount) / 2 * fontSize;
yLine = y + (1 - lineCount) / (2 * fontSize);
for (var i = 0; i < lineCount; i++) {
ctx.fillText(lines[i], x, yLine);

+ 2
- 2
dist/vis.min.js
File diff suppressed because it is too large
View File


+ 1
- 1
src/graph/Node.js View File

@ -855,7 +855,7 @@ Node.prototype._label = function (ctx, text, x, y, align, baseline) {
var lines = text.split('\n'),
lineCount = lines.length,
fontSize = (this.fontSize + 4),
yLine = y + (1 - lineCount) / 2 * fontSize;
yLine = y + (1 - lineCount) / (2 * fontSize);
for (var i = 0; i < lineCount; i++) {
ctx.fillText(lines[i], x, yLine);

Loading…
Cancel
Save