Browse Source

Fixed dashed and arrow lines not using inheritColor. #399

v3_develop
Alex de Mulder 10 years ago
parent
commit
3183aff621
3 changed files with 26266 additions and 26308 deletions
  1. +5
    -0
      HISTORY.md
  2. +26255
    -26294
      dist/vis.js
  3. +6
    -14
      lib/network/Edge.js

+ 5
- 0
HISTORY.md View File

@ -8,6 +8,11 @@ http://visjs.org
- Fixed background items not always be cleared when removing them. - Fixed background items not always be cleared when removing them.
### Network
- Fixed dashed and arrow lines not using inheritColor.
## 2014-10-24, version 3.6.2 ## 2014-10-24, version 3.6.2

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


+ 6
- 14
lib/network/Edge.js View File

@ -244,7 +244,7 @@ Edge.prototype._getColor = function() {
if (this.selected == true) {return colorObj.highlight;} if (this.selected == true) {return colorObj.highlight;}
else if (this.hover == true) {return colorObj.hover;} else if (this.hover == true) {return colorObj.hover;}
else {return colorObj.color;} else {return colorObj.color;}
}
};
/** /**
@ -481,7 +481,7 @@ Edge.prototype._getViaCoordinates = function () {
return {x:xVia, y:yVia}; return {x:xVia, y:yVia};
}
};
/** /**
* Draw a line between two nodes * Draw a line between two nodes
@ -601,10 +601,7 @@ Edge.prototype._label = function (ctx, text, x, y) {
*/ */
Edge.prototype._drawDashLine = function(ctx) { Edge.prototype._drawDashLine = function(ctx) {
// set style // set style
if (this.selected == true) {ctx.strokeStyle = this.options.color.highlight;}
else if (this.hover == true) {ctx.strokeStyle = this.options.color.hover;}
else {ctx.strokeStyle = this.options.color.color;}
ctx.strokeStyle = this._getColor();
ctx.lineWidth = this._getLineWidth(); ctx.lineWidth = this._getLineWidth();
var via = null; var via = null;
@ -719,9 +716,7 @@ Edge.prototype._pointOnCircle = function (x, y, radius, percentage) {
Edge.prototype._drawArrowCenter = function(ctx) { Edge.prototype._drawArrowCenter = function(ctx) {
var point; var point;
// set style // set style
if (this.selected == true) {ctx.strokeStyle = this.options.color.highlight; ctx.fillStyle = this.options.color.highlight;}
else if (this.hover == true) {ctx.strokeStyle = this.options.color.hover; ctx.fillStyle = this.options.color.hover;}
else {ctx.strokeStyle = this.options.color.color; ctx.fillStyle = this.options.color.color;}
ctx.strokeStyle = this._getColor();
ctx.lineWidth = this._getLineWidth(); ctx.lineWidth = this._getLineWidth();
if (this.from != this.to) { if (this.from != this.to) {
@ -794,10 +789,7 @@ Edge.prototype._drawArrowCenter = function(ctx) {
*/ */
Edge.prototype._drawArrow = function(ctx) { Edge.prototype._drawArrow = function(ctx) {
// set style // set style
if (this.selected == true) {ctx.strokeStyle = this.options.color.highlight; ctx.fillStyle = this.options.color.highlight;}
else if (this.hover == true) {ctx.strokeStyle = this.options.color.hover; ctx.fillStyle = this.options.color.hover;}
else {ctx.strokeStyle = this.options.color.color; ctx.fillStyle = this.options.color.color;}
ctx.strokeStyle = this._getColor();
ctx.lineWidth = this._getLineWidth(); ctx.lineWidth = this._getLineWidth();
var angle, length; var angle, length;
@ -1015,7 +1007,7 @@ Edge.prototype._getDistanceToLine = function(x1,y1,x2,y2,x3,y3) {
//# (i.e. remove the sqrt) to gain a little performance //# (i.e. remove the sqrt) to gain a little performance
return Math.sqrt(dx*dx + dy*dy); return Math.sqrt(dx*dx + dy*dy);
}
};
/** /**
* This allows the zoom level of the network to influence the rendering * This allows the zoom level of the network to influence the rendering

Loading…
Cancel
Save