Browse Source

- Fixed arrows with some shapes when they are selected. #1292

webworkersNetwork
Alex de Mulder 9 years ago
parent
commit
fd48470add
9 changed files with 17 additions and 14 deletions
  1. +1
    -0
      HISTORY.md
  2. +8
    -7
      dist/vis.js
  3. +1
    -1
      lib/network/modules/components/nodes/shapes/Diamond.js
  4. +1
    -0
      lib/network/modules/components/nodes/shapes/Dot.js
  5. +1
    -2
      lib/network/modules/components/nodes/shapes/Square.js
  6. +1
    -1
      lib/network/modules/components/nodes/shapes/Star.js
  7. +1
    -1
      lib/network/modules/components/nodes/shapes/Triangle.js
  8. +1
    -1
      lib/network/modules/components/nodes/shapes/TriangleDown.js
  9. +2
    -1
      lib/network/modules/components/nodes/util/NodeBase.js

+ 1
- 0
HISTORY.md View File

@ -9,6 +9,7 @@ http://visjs.org
- Fixed scaling not doing anything to edges. - Fixed scaling not doing anything to edges.
- Fixed setting font to null so the network won't crash anymore. - Fixed setting font to null so the network won't crash anymore.
- Fixed stabilized event not firing if layout algorithm does very well. - Fixed stabilized event not firing if layout algorithm does very well.
- Fixed arrows with some shapes when they are selected. #1292
## 2015-09-07, version 4.8.1 ## 2015-09-07, version 4.8.1

+ 8
- 7
dist/vis.js View File

@ -29073,8 +29073,9 @@ return /******/ (function(modules) { // webpackBootstrap
} }
}, { }, {
key: '_distanceToBorder', key: '_distanceToBorder',
value: function _distanceToBorder(angle) {
value: function _distanceToBorder(ctx, angle) {
var borderWidth = 1; var borderWidth = 1;
this.resize(ctx);
return Math.min(Math.abs(this.width / 2 / Math.cos(angle)), Math.abs(this.height / 2 / Math.sin(angle))) + borderWidth; return Math.min(Math.abs(this.width / 2 / Math.cos(angle)), Math.abs(this.height / 2 / Math.sin(angle))) + borderWidth;
} }
}, { }, {
@ -29659,7 +29660,7 @@ return /******/ (function(modules) { // webpackBootstrap
}, { }, {
key: 'distanceToBorder', key: 'distanceToBorder',
value: function distanceToBorder(ctx, angle) { value: function distanceToBorder(ctx, angle) {
return this._distanceToBorder(angle);
return this._distanceToBorder(ctx, angle);
} }
}]); }]);
@ -29821,6 +29822,7 @@ return /******/ (function(modules) { // webpackBootstrap
}, { }, {
key: 'distanceToBorder', key: 'distanceToBorder',
value: function distanceToBorder(ctx, angle) { value: function distanceToBorder(ctx, angle) {
this.resize(ctx);
return this.options.size + this.options.borderWidth; return this.options.size + this.options.borderWidth;
} }
}]); }]);
@ -30197,8 +30199,7 @@ return /******/ (function(modules) { // webpackBootstrap
}, { }, {
key: 'distanceToBorder', key: 'distanceToBorder',
value: function distanceToBorder(ctx, angle) { value: function distanceToBorder(ctx, angle) {
this.resize();
return this._distanceToBorder(angle);
return this._distanceToBorder(ctx, angle);
} }
}]); }]);
@ -30254,7 +30255,7 @@ return /******/ (function(modules) { // webpackBootstrap
}, { }, {
key: 'distanceToBorder', key: 'distanceToBorder',
value: function distanceToBorder(ctx, angle) { value: function distanceToBorder(ctx, angle) {
return this._distanceToBorder(angle);
return this._distanceToBorder(ctx, angle);
} }
}]); }]);
@ -30397,7 +30398,7 @@ return /******/ (function(modules) { // webpackBootstrap
}, { }, {
key: 'distanceToBorder', key: 'distanceToBorder',
value: function distanceToBorder(ctx, angle) { value: function distanceToBorder(ctx, angle) {
return this._distanceToBorder(angle);
return this._distanceToBorder(ctx, angle);
} }
}]); }]);
@ -30453,7 +30454,7 @@ return /******/ (function(modules) { // webpackBootstrap
}, { }, {
key: 'distanceToBorder', key: 'distanceToBorder',
value: function distanceToBorder(ctx, angle) { value: function distanceToBorder(ctx, angle) {
return this._distanceToBorder(angle);
return this._distanceToBorder(ctx, angle);
} }
}]); }]);

+ 1
- 1
lib/network/modules/components/nodes/shapes/Diamond.js View File

@ -16,7 +16,7 @@ class Diamond extends ShapeBase {
} }
distanceToBorder(ctx, angle) { distanceToBorder(ctx, angle) {
return this._distanceToBorder(angle);
return this._distanceToBorder(ctx,angle);
} }
} }

+ 1
- 0
lib/network/modules/components/nodes/shapes/Dot.js View File

@ -16,6 +16,7 @@ class Dot extends ShapeBase {
} }
distanceToBorder(ctx, angle) { distanceToBorder(ctx, angle) {
this.resize(ctx);
return this.options.size + this.options.borderWidth; return this.options.size + this.options.borderWidth;
} }
} }

+ 1
- 2
lib/network/modules/components/nodes/shapes/Square.js View File

@ -16,8 +16,7 @@ class Square extends ShapeBase {
} }
distanceToBorder(ctx, angle) { distanceToBorder(ctx, angle) {
this.resize();
return this._distanceToBorder(angle);
return this._distanceToBorder(ctx,angle);
} }
} }

+ 1
- 1
lib/network/modules/components/nodes/shapes/Star.js View File

@ -16,7 +16,7 @@ class Star extends ShapeBase {
} }
distanceToBorder(ctx, angle) { distanceToBorder(ctx, angle) {
return this._distanceToBorder(angle);
return this._distanceToBorder(ctx,angle);
} }
} }

+ 1
- 1
lib/network/modules/components/nodes/shapes/Triangle.js View File

@ -16,7 +16,7 @@ class Triangle extends ShapeBase {
} }
distanceToBorder(ctx, angle) { distanceToBorder(ctx, angle) {
return this._distanceToBorder(angle);
return this._distanceToBorder(ctx,angle);
} }
} }

+ 1
- 1
lib/network/modules/components/nodes/shapes/TriangleDown.js View File

@ -16,7 +16,7 @@ class TriangleDown extends ShapeBase {
} }
distanceToBorder(ctx, angle) { distanceToBorder(ctx, angle) {
return this._distanceToBorder(angle);
return this._distanceToBorder(ctx,angle);
} }
} }

+ 2
- 1
lib/network/modules/components/nodes/util/NodeBase.js View File

@ -15,8 +15,9 @@ class NodeBase {
this.options = options; this.options = options;
} }
_distanceToBorder(angle) {
_distanceToBorder(ctx,angle) {
var borderWidth = 1; var borderWidth = 1;
this.resize(ctx);
return Math.min( return Math.min(
Math.abs(this.width / 2 / Math.cos(angle)), Math.abs(this.width / 2 / Math.cos(angle)),
Math.abs(this.height / 2 / Math.sin(angle))) + borderWidth; Math.abs(this.height / 2 / Math.sin(angle))) + borderWidth;

Loading…
Cancel
Save