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.
- +