From 0bbeb934b95cd6b1238d7f51062de216d209d98b Mon Sep 17 00:00:00 2001 From: Alex de Mulder Date: Mon, 6 Jul 2015 09:26:46 +0200 Subject: [PATCH] properly fixed the _lockedRedraw method --- HISTORY.md | 4 ++++ dist/vis.js | 6 +++--- lib/network/modules/View.js | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 85e9d773..da180ac9 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -3,6 +3,10 @@ http://visjs.org ## not yet released, version 4.4.1-SNAPSHOT +### Network + +- Properly fixed the _lockedRedraw method. + ## 2015-07-03, version 4.4.0 ### General diff --git a/dist/vis.js b/dist/vis.js index 1884d7f9..93bc37ce 100644 --- a/dist/vis.js +++ b/dist/vis.js @@ -4,8 +4,8 @@ * * A dynamic, browser-based visualization library. * - * @version 4.4.0 - * @date 2015-07-03 + * @version 4.4.1-SNAPSHOT + * @date 2015-07-06 * * @license * Copyright (C) 2011-2014 Almende B.V, http://almende.com @@ -35729,7 +35729,7 @@ return /******/ (function(modules) { // webpackBootstrap */ value: function _lockedRedraw() { 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 x: viewCenter.x - nodePosition.x, y: viewCenter.y - nodePosition.y diff --git a/lib/network/modules/View.js b/lib/network/modules/View.js index eb1450d4..58683115 100644 --- a/lib/network/modules/View.js +++ b/lib/network/modules/View.js @@ -269,7 +269,7 @@ class View { */ _lockedRedraw() { 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 x: viewCenter.x - nodePosition.x, y: viewCenter.y - nodePosition.y