From 04fb1aea647d5635b068591c3c9fe9ce7f6015ce Mon Sep 17 00:00:00 2001 From: Alex de Mulder Date: Mon, 4 May 2015 13:49:59 +0200 Subject: [PATCH] added a setSize to the redraw function --- lib/network/modules/Canvas.js | 1 + lib/network/modules/CanvasRenderer.js | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/network/modules/Canvas.js b/lib/network/modules/Canvas.js index 347a7300..327fab9b 100644 --- a/lib/network/modules/Canvas.js +++ b/lib/network/modules/Canvas.js @@ -38,6 +38,7 @@ class Canvas { this.body.view.translation.y = obj.height * 0.5; } }); + this.body.emitter.on("setSize", this.setSize.bind(this)); this.body.emitter.on("destroy", () => { this.hammerFrame.destroy(); this.hammer.destroy(); diff --git a/lib/network/modules/CanvasRenderer.js b/lib/network/modules/CanvasRenderer.js index 078ce037..c3ccac12 100644 --- a/lib/network/modules/CanvasRenderer.js +++ b/lib/network/modules/CanvasRenderer.js @@ -111,6 +111,7 @@ class CanvasRenderer { * chart will be resized too. */ redraw() { + this.body.emitter.emit('setSize'); this._redraw(); }