Browse Source

fixed alignment issue with edge labels

v3_develop
Alex de Mulder 9 years ago
parent
commit
3d744d1236
3 changed files with 9 additions and 2 deletions
  1. +1
    -0
      HISTORY.md
  2. +4
    -1
      dist/vis.js
  3. +4
    -1
      lib/network/Edge.js

+ 1
- 0
HISTORY.md View File

@ -20,6 +20,7 @@ http://visjs.org
- Added condition to Repulsion similar to BarnesHut to ensure nodes do not overlap.
- Added labelAlignment option to edges. Thanks @T-rav!
- Close active sessions in dataManipulation when calling setData().
- Fixed alignment issue with edgelabels
### Timeline

+ 4
- 1
dist/vis.js View File

@ -28196,6 +28196,7 @@ return /******/ (function(modules) { // webpackBootstrap
x = 0;
yLine = 0;
}
this._drawLabelRect(ctx);
this._drawLabelText(ctx,x,yLine, lines, lineCount, fontSize);
@ -28244,7 +28245,6 @@ return /******/ (function(modules) { // webpackBootstrap
ctx.fillRect(-this.labelDimensions.width * 0.5, lineMargin, this.labelDimensions.width, this.labelDimensions.height);
}
else {
ctx.fillStyle = this.options.fontFill;
ctx.fillRect(this.labelDimensions.left, this.labelDimensions.top, this.labelDimensions.width, this.labelDimensions.height);
}
}
@ -28280,6 +28280,9 @@ return /******/ (function(modules) { // webpackBootstrap
ctx.textBaseline = "middle";
}
}
else {
ctx.textBaseline = "middle";
}
// check for strokeWidth
if (this.options.fontStrokeWidth > 0){

+ 4
- 1
lib/network/Edge.js View File

@ -591,6 +591,7 @@ Edge.prototype._label = function (ctx, text, x, y) {
x = 0;
yLine = 0;
}
this._drawLabelRect(ctx);
this._drawLabelText(ctx,x,yLine, lines, lineCount, fontSize);
@ -639,7 +640,6 @@ Edge.prototype._drawLabelRect = function(ctx) {
ctx.fillRect(-this.labelDimensions.width * 0.5, lineMargin, this.labelDimensions.width, this.labelDimensions.height);
}
else {
ctx.fillStyle = this.options.fontFill;
ctx.fillRect(this.labelDimensions.left, this.labelDimensions.top, this.labelDimensions.width, this.labelDimensions.height);
}
}
@ -675,6 +675,9 @@ Edge.prototype._drawLabelText = function(ctx, x, yLine, lines, lineCount, fontSi
ctx.textBaseline = "middle";
}
}
else {
ctx.textBaseline = "middle";
}
// check for strokeWidth
if (this.options.fontStrokeWidth > 0){

Loading…
Cancel
Save