diff --git a/package-lock.json b/package-lock.json index 96ea88cf2..ee267b28e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "packages": { "": { "name": "cytoscape", - "version": "3.30.0-unstable", + "version": "3.31.0-unstable", "license": "MIT", "devDependencies": { "@babel/core": "^7.3.4", diff --git a/src/extensions/layout/breadthfirst.js b/src/extensions/layout/breadthfirst.js index eeaa2e01d..565a4a6a1 100644 --- a/src/extensions/layout/breadthfirst.js +++ b/src/extensions/layout/breadthfirst.js @@ -48,8 +48,9 @@ BreadthFirstLayout.prototype.run = function(){ const maximal = options.acyclic || options.maximal || options.maximalAdjustments > 0; // maximalAdjustments for compat. w/ old code; also, setting acyclic to true sets maximal to true const hasBoundingBox = !!options.boundingBox; + const cyExtent = cy.extent(); const bb = math.makeBoundingBox( hasBoundingBox ? options.boundingBox : { - x1: 0, y1: 0, w: cy.width(), h: cy.height() + x1: cyExtent.x1, y1: cyExtent.y1, w: cyExtent.w, h: cyExtent.h } ); let roots;