Browse Source

- Community fix for SVG images in IE11, thanks @dponch!

v3_develop
Alex de Mulder 10 years ago
parent
commit
350e69b5fb
4 changed files with 21 additions and 4 deletions
  1. +1
    -0
      HISTORY.md
  2. +10
    -2
      dist/vis.js
  3. +9
    -0
      lib/network/Images.js
  4. +1
    -2
      lib/network/Network.js

+ 1
- 0
HISTORY.md View File

@ -23,6 +23,7 @@ http://visjs.org
- Improved physics handling for smoother network simulation. - Improved physics handling for smoother network simulation.
- Fixed infinite loop when an image can not be found and no brokenImage is provided. - Fixed infinite loop when an image can not be found and no brokenImage is provided.
- Added getBoundingBox method. - Added getBoundingBox method.
- Community fix for SVG images in IE11, thanks @dponch!
### Graph2d ### Graph2d

+ 10
- 2
dist/vis.js View File

@ -24650,6 +24650,7 @@ return /******/ (function(modules) { // webpackBootstrap
if (this.constants.smoothCurves.enabled == true && this.constants.smoothCurves.dynamic == true) { if (this.constants.smoothCurves.enabled == true && this.constants.smoothCurves.dynamic == true) {
supportMovingStatus = this._doInSupportSector("_discreteStepNodes"); supportMovingStatus = this._doInSupportSector("_discreteStepNodes");
} }
// gather movement data from all sectors, if one moves, we are NOT stabilzied // gather movement data from all sectors, if one moves, we are NOT stabilzied
for (var i = 0; i < mainMoving.length; i++) {mainMovingStatus = mainMoving[0] || mainMovingStatus;} for (var i = 0; i < mainMoving.length; i++) {mainMovingStatus = mainMoving[0] || mainMovingStatus;}
@ -24709,8 +24710,6 @@ return /******/ (function(modules) { // webpackBootstrap
} }
if (!this.timer) { if (!this.timer) {
if (this.requiresTimeout == true) { if (this.requiresTimeout == true) {
this.timer = window.setTimeout(this._animationStep.bind(this), this.renderTimestep); // wait this.renderTimeStep milliseconds and perform the animation step function this.timer = window.setTimeout(this._animationStep.bind(this), this.renderTimestep); // wait this.renderTimeStep milliseconds and perform the animation step function
} }
@ -27543,6 +27542,15 @@ return /******/ (function(modules) { // webpackBootstrap
var me = this; var me = this;
var img = new Image(); var img = new Image();
img.onload = function () { img.onload = function () {
// IE11 fix -- thanks dponch!
if (this.width == 0) {
document.body.appendChild(this);
this.width = this.offsetWidth;
this.height = this.offsetHeight;
document.body.removeChild(this);
}
if (me.callback) { if (me.callback) {
me.images[url] = img; me.images[url] = img;
me.callback(this); me.callback(this);

+ 9
- 0
lib/network/Images.js View File

@ -28,6 +28,15 @@ Images.prototype.load = function(url, brokenUrl) {
var me = this; var me = this;
var img = new Image(); var img = new Image();
img.onload = function () { img.onload = function () {
// IE11 fix -- thanks dponch!
if (this.width == 0) {
document.body.appendChild(this);
this.width = this.offsetWidth;
this.height = this.offsetHeight;
document.body.removeChild(this);
}
if (me.callback) { if (me.callback) {
me.images[url] = img; me.images[url] = img;
me.callback(this); me.callback(this);

+ 1
- 2
lib/network/Network.js View File

@ -2165,6 +2165,7 @@ Network.prototype._physicsTick = function() {
if (this.constants.smoothCurves.enabled == true && this.constants.smoothCurves.dynamic == true) { if (this.constants.smoothCurves.enabled == true && this.constants.smoothCurves.dynamic == true) {
supportMovingStatus = this._doInSupportSector("_discreteStepNodes"); supportMovingStatus = this._doInSupportSector("_discreteStepNodes");
} }
// gather movement data from all sectors, if one moves, we are NOT stabilzied // gather movement data from all sectors, if one moves, we are NOT stabilzied
for (var i = 0; i < mainMoving.length; i++) {mainMovingStatus = mainMoving[0] || mainMovingStatus;} for (var i = 0; i < mainMoving.length; i++) {mainMovingStatus = mainMoving[0] || mainMovingStatus;}
@ -2224,8 +2225,6 @@ Network.prototype.start = function() {
} }
if (!this.timer) { if (!this.timer) {
if (this.requiresTimeout == true) { if (this.requiresTimeout == true) {
this.timer = window.setTimeout(this._animationStep.bind(this), this.renderTimestep); // wait this.renderTimeStep milliseconds and perform the animation step function this.timer = window.setTimeout(this._animationStep.bind(this), this.renderTimestep); // wait this.renderTimeStep milliseconds and perform the animation step function
} }

Loading…
Cancel
Save