Browse Source

- Fixed minor bug in positioning of fontFill of nodes with certain shapes.

v3_develop
Alex de Mulder 10 years ago
parent
commit
c2866fb50c
4 changed files with 2025 additions and 2022 deletions
  1. +1
    -1
      HISTORY.md
  2. +2020
    -2017
      dist/vis.js
  3. +1
    -4
      examples/network/02_random_nodes.html
  4. +3
    -0
      lib/network/Node.js

+ 1
- 1
HISTORY.md View File

@ -9,7 +9,7 @@ http://visjs.org
- Changed timings for zoomExtent animation. - Changed timings for zoomExtent animation.
- Fixed possible cause of freezing graph when animating. - Fixed possible cause of freezing graph when animating.
- Added locked to focusOnNode and releaseNode(). - Added locked to focusOnNode and releaseNode().
- Fixed minor bug in positioning of fontFill of nodes with certain shapes.
## 2014-10-11, version 3.4.1 ## 2014-10-11, version 3.4.1

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


+ 1
- 4
examples/network/02_random_nodes.html View File

@ -76,7 +76,7 @@
nodes: nodes, nodes: nodes,
edges: edges edges: edges
}; };
var options = {stabilize:false};
var options = {};
network = new vis.Network(container, data, options); network = new vis.Network(container, data, options);
// add event listeners // add event listeners
@ -88,9 +88,6 @@
document.getElementById('stabilization').innerHTML = 'Stabilization took ' + params.iterations + ' iterations.'; document.getElementById('stabilization').innerHTML = 'Stabilization took ' + params.iterations + ' iterations.';
doFocus = false; doFocus = false;
}); });
network.focusOnNode(0,{animation:false, locked: true});
} }
</script> </script>
</head> </head>

+ 3
- 0
lib/network/Node.js View File

@ -865,6 +865,9 @@ Node.prototype._label = function (ctx, text, x, y, align, baseline, labelUnderNo
var height = this.options.fontSize * lineCount; var height = this.options.fontSize * lineCount;
var left = x - width / 2; var left = x - width / 2;
var top = y - height / 2; var top = y - height / 2;
if (ctx.textBaseline == "top") {
top += 0.5 * fontSize;
}
ctx.fillStyle = this.options.fontFill; ctx.fillStyle = this.options.fontFill;
ctx.fillRect(left, top, width, height); ctx.fillRect(left, top, width, height);
} }

Loading…
Cancel
Save