Browse Source

- Fixed bug when redrawing was not right on zoomed-out browsers.

v3_develop
Alex de Mulder 10 years ago
parent
commit
5d964c0237
3 changed files with 2156 additions and 2152 deletions
  1. +1
    -0
      HISTORY.md
  2. +2152
    -2150
      dist/vis.js
  3. +3
    -2
      lib/network/Network.js

+ 1
- 0
HISTORY.md View File

@ -15,6 +15,7 @@ http://visjs.org
- Added stabilizationIterationsDone event which fires at the end of the internal stabilization run. Does not imply that the network is stabilized.
- Added setFreezeSimulation method.
- Added clusterByZoom option and increaseClusterLevel and decreaseClusterLevel methods.
- Fixed bug when redrawing was not right on zoomed-out browsers.
### DataSet/DataView

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


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

@ -849,6 +849,7 @@ Network.prototype._create = function () {
ctx.oBackingStorePixelRatio ||
ctx.backingStorePixelRatio || 1);
this.pixelRatio = Math.max(1,this.pixelRatio); // this is to account for browser zooming out. The pixel ratio is ment to switch between 1 and 2 for HD screens.
this.frame.canvas.getContext("2d").setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0);
}
@ -1920,8 +1921,8 @@ Network.prototype._redraw = function(hidden) {
ctx.setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0);
// clear the canvas
var w = this.frame.canvas.width * this.pixelRatio;
var h = this.frame.canvas.height * this.pixelRatio;
var w = this.frame.canvas.clientWidth * this.pixelRatio;
var h = this.frame.canvas.clientHeight * this.pixelRatio;
ctx.clearRect(0, 0, w, h);
// set scaling and translation

Loading…
Cancel
Save