diff --git a/lib/draw/BpmnRenderer.js b/lib/draw/BpmnRenderer.js index 6fda3ed2..b6638994 100644 --- a/lib/draw/BpmnRenderer.js +++ b/lib/draw/BpmnRenderer.js @@ -1373,7 +1373,13 @@ function BpmnRenderer(eventBus, styles, pathMap, priority) { var textElement = renderExternalLabel(parentGfx, element); - var textBBox = textElement.getBBox(); + var textBBox; + + try { + textBBox = textElement.getBBox(); + } catch (e) { + textBBox = { width: 0, height: 0, x: 0 }; + } // update element.x so that the layouted text is still // center alligned (newX = oldMidX - newWidth / 2) diff --git a/package.json b/package.json index fac4eb2f..97a2b2fb 100644 --- a/package.json +++ b/package.json @@ -54,14 +54,14 @@ "karma-firefox-launcher": "^0.1.3", "karma-ie-launcher": "^0.2.0", "karma-mocha": "~0.1.0", - "karma-phantomjs-launcher": "^0.2.0", + "karma-phantomjs-launcher": "^1.0.2", "karma-safari-launcher": "^0.1.1", "karma-sinon-chai": "~0.3.0", "karma-spec-reporter": "0.0.26", "load-grunt-tasks": "^0.3.0", "mocha": "^2.2.5", "mocha-test-container-support": "0.2.0", - "phantomjs": "^2.1.7", + "phantomjs-prebuilt": "^2.1.12", "sinon": "~1.14.1", "sinon-chai": "~2.7.0", "source-map-concat": "^1.0.0", @@ -80,6 +80,6 @@ "lodash": "^3.0.1", "min-dom": "^0.2.0", "object-refs": "^0.1.1", - "tiny-svg": "0.0.1" + "tiny-svg": "git://github.com/bpmn-io/tiny-svg.git#master" } } diff --git a/test/spec/features/label-editing/LabelEditingProviderSpec.js b/test/spec/features/label-editing/LabelEditingProviderSpec.js index 78985aab..d199fdda 100644 --- a/test/spec/features/label-editing/LabelEditingProviderSpec.js +++ b/test/spec/features/label-editing/LabelEditingProviderSpec.js @@ -50,6 +50,9 @@ describe('features - label-editing', function() { // then expect(directEditing.isActive()).to.be.true; + + // clean up + directEditing._textbox.destroy(); }));