Browse Source

properly fixed the _lockedRedraw method

flowchartTest
Alex de Mulder 9 years ago
parent
commit
0bbeb934b9
3 changed files with 8 additions and 4 deletions
  1. +4
    -0
      HISTORY.md
  2. +3
    -3
      dist/vis.js
  3. +1
    -1
      lib/network/modules/View.js

+ 4
- 0
HISTORY.md View File

@ -3,6 +3,10 @@ http://visjs.org
## not yet released, version 4.4.1-SNAPSHOT ## not yet released, version 4.4.1-SNAPSHOT
### Network
- Properly fixed the _lockedRedraw method.
## 2015-07-03, version 4.4.0 ## 2015-07-03, version 4.4.0
### General ### General

+ 3
- 3
dist/vis.js View File

@ -4,8 +4,8 @@
* *
* A dynamic, browser-based visualization library. * A dynamic, browser-based visualization library.
* *
* @version 4.4.0
* @date 2015-07-03
* @version 4.4.1-SNAPSHOT
* @date 2015-07-06
* *
* @license * @license
* Copyright (C) 2011-2014 Almende B.V, http://almende.com * Copyright (C) 2011-2014 Almende B.V, http://almende.com
@ -35729,7 +35729,7 @@ return /******/ (function(modules) { // webpackBootstrap
*/ */
value: function _lockedRedraw() { value: function _lockedRedraw() {
var nodePosition = { x: this.body.nodes[this.lockedOnNodeId].x, y: this.body.nodes[this.lockedOnNodeId].y }; var nodePosition = { x: this.body.nodes[this.lockedOnNodeId].x, y: this.body.nodes[this.lockedOnNodeId].y };
var viewCenter = this.canvas.DOMtoCanvas({ x: 0.5 * this.frame.canvas.clientWidth, y: 0.5 * this.frame.canvas.clientHeight });
var viewCenter = this.canvas.DOMtoCanvas({ x: 0.5 * this.canvas.frame.canvas.clientWidth, y: 0.5 * this.canvas.frame.canvas.clientHeight });
var distanceFromCenter = { // offset from view, distance view has to change by these x and y to center the node var distanceFromCenter = { // offset from view, distance view has to change by these x and y to center the node
x: viewCenter.x - nodePosition.x, x: viewCenter.x - nodePosition.x,
y: viewCenter.y - nodePosition.y y: viewCenter.y - nodePosition.y

+ 1
- 1
lib/network/modules/View.js View File

@ -269,7 +269,7 @@ class View {
*/ */
_lockedRedraw() { _lockedRedraw() {
var nodePosition = {x: this.body.nodes[this.lockedOnNodeId].x, y: this.body.nodes[this.lockedOnNodeId].y}; var nodePosition = {x: this.body.nodes[this.lockedOnNodeId].x, y: this.body.nodes[this.lockedOnNodeId].y};
var viewCenter = this.canvas.DOMtoCanvas({x: 0.5 * this.frame.canvas.clientWidth, y: 0.5 * this.frame.canvas.clientHeight});
var viewCenter = this.canvas.DOMtoCanvas({x: 0.5 * this.canvas.frame.canvas.clientWidth, y: 0.5 * this.canvas.frame.canvas.clientHeight});
var distanceFromCenter = { // offset from view, distance view has to change by these x and y to center the node var distanceFromCenter = { // offset from view, distance view has to change by these x and y to center the node
x: viewCenter.x - nodePosition.x, x: viewCenter.x - nodePosition.x,
y: viewCenter.y - nodePosition.y y: viewCenter.y - nodePosition.y

Loading…
Cancel
Save