From 7a6246ecc2509cf149bfb15acda701fb1b852942 Mon Sep 17 00:00:00 2001 From: Alex de Mulder Date: Fri, 18 Sep 2015 16:18:24 +0200 Subject: [PATCH] - Fixed bug where a box shape could not be drawn outside of the viewable area. --- HISTORY.md | 1 + dist/vis.js | 5 +- .../modules/components/nodes/shapes/Box.js | 5 +- test/networkTest.html | 7694 +---------------- 4 files changed, 120 insertions(+), 7585 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 6b2edf0f..1f5264c4 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -6,6 +6,7 @@ http://visjs.org ### Network - Fixed bug where an edge that was not connected would crash the layout algorithms. +- Fixed bug where a box shape could not be drawn outside of the viewable area. ## 2015-09-14, version 4.8.2 diff --git a/dist/vis.js b/dist/vis.js index 4ee7ec12..4e7f44a2 100644 --- a/dist/vis.js +++ b/dist/vis.js @@ -29099,12 +29099,13 @@ return /******/ (function(modules) { // webpackBootstrap this.disableBorderDashes(ctx); ctx.restore(); - this.updateBoundingBox(x, y); + this.updateBoundingBox(x, y, ctx, selected); this.labelModule.draw(ctx, x, y, selected); } }, { key: 'updateBoundingBox', - value: function updateBoundingBox(x, y) { + value: function updateBoundingBox(x, y, ctx, selected) { + this.resize(ctx, selected); this.left = x - this.width * 0.5; this.top = y - this.height * 0.5; diff --git a/lib/network/modules/components/nodes/shapes/Box.js b/lib/network/modules/components/nodes/shapes/Box.js index 9e9b78f5..85abddcc 100644 --- a/lib/network/modules/components/nodes/shapes/Box.js +++ b/lib/network/modules/components/nodes/shapes/Box.js @@ -51,11 +51,12 @@ class Box extends NodeBase { this.disableBorderDashes(ctx); ctx.restore(); - this.updateBoundingBox(x,y); + this.updateBoundingBox(x,y,ctx,selected); this.labelModule.draw(ctx, x, y, selected); } - updateBoundingBox(x,y) { + updateBoundingBox(x,y, ctx, selected) { + this.resize(ctx, selected); this.left = x - this.width * 0.5; this.top = y - this.height * 0.5; diff --git a/test/networkTest.html b/test/networkTest.html index 3b3615b8..19230782 100644 --- a/test/networkTest.html +++ b/test/networkTest.html @@ -19,7596 +19,128 @@

Create a simple network with some nodes and edges.

- +