Browse Source

- Fixed bug where zoomExtent does not work as expected.

v3_develop
Alex de Mulder 10 years ago
parent
commit
bfb819df83
3 changed files with 2133 additions and 2146 deletions
  1. +1
    -0
      HISTORY.md
  2. +2127
    -2134
      dist/vis.js
  3. +5
    -12
      lib/network/Network.js

+ 1
- 0
HISTORY.md View File

@ -7,6 +7,7 @@ http://visjs.org
### Network
- Fixed bug where opening a cluster with smoothCurves off caused one child to go crazy.
- Fixed bug where zoomExtent does not work as expected.
## 2015-01-16, version 3.9.0

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


+ 5
- 12
lib/network/Network.js View File

@ -410,8 +410,8 @@ Network.prototype._getRange = function() {
node = this.nodes[nodeId];
if (minX > (node.boundingBox.left)) {minX = node.boundingBox.left;}
if (maxX < (node.boundingBox.right)) {maxX = node.boundingBox.right;}
if (minY > (node.boundingBox.bottom)) {minY = node.boundingBox.bottom;}
if (maxY < (node.boundingBox.top)) {maxY = node.boundingBox.top;}
if (minY > (node.boundingBox.bottom)) {minY = node.boundingBox.top;} // top is negative, bottom is positive
if (maxY < (node.boundingBox.top)) {maxY = node.boundingBox.bottom;} // top is negative, bottom is positive
}
}
if (minX == 1e9 && maxX == -1e9 && minY == 1e9 && maxY == -1e9) {
@ -441,15 +441,9 @@ Network.prototype._findCenter = function(range) {
Network.prototype.zoomExtent = function(animationOptions, initialZoom, disableStart) {
this._redraw(true);
if (initialZoom === undefined) {
initialZoom = false;
}
if (disableStart === undefined) {
disableStart = false;
}
if (animationOptions === undefined) {
animationOptions = false;
}
if (initialZoom === undefined) {initialZoom = false;}
if (disableStart === undefined) {disableStart = false;}
if (animationOptions === undefined) {animationOptions = false;}
var range = this._getRange();
var zoomLevel;
@ -485,7 +479,6 @@ Network.prototype.zoomExtent = function(animationOptions, initialZoom, disableSt
var xZoomLevel = this.frame.canvas.clientWidth / xDistance;
var yZoomLevel = this.frame.canvas.clientHeight / yDistance;
zoomLevel = (xZoomLevel <= yZoomLevel) ? xZoomLevel : yZoomLevel;
}

Loading…
Cancel
Save