chore(draw/BpmnRenderer): exposed _drawPath helper

This allows extensions to reuse the internal drawPath utility.

Cf. #722 for context.
This commit is contained in:
felixlinker 2017-11-10 21:07:26 +01:00 committed by Nico Rehwaldt
parent abddbb0889
commit 0cb46183eb
2 changed files with 28 additions and 1 deletions

View File

@ -1755,6 +1755,11 @@ function BpmnRenderer(eventBus, styles, pathMap, canvas, priority) {
strokeWidth: 2 strokeWidth: 2
}); });
} }
// extension API, use at your own risk
this._drawPath = drawPath;
} }

View File

@ -222,7 +222,7 @@ describe('draw - bpmn renderer', function() {
it('should add random ID suffix to marker ID', function(done) { it('should add random ID suffix to marker ID', function(done) {
var xml = require('../../fixtures/bpmn/simple.bpmn'); var xml = require('../../fixtures/bpmn/simple.bpmn');
bootstrapViewer(xml)(function(err) { bootstrapViewer(xml)(function(err) {
@ -331,4 +331,26 @@ describe('draw - bpmn renderer', function() {
}); });
describe('extension API', function() {
var diagramXML = require('../../fixtures/bpmn/simple.bpmn');
beforeEach(bootstrapModeler(diagramXML, {
modules: [
coreModule,
rendererModule
]
}));
it('should expose helpers', inject(function(bpmnRenderer) {
// then
expect(bpmnRenderer._drawPath).to.be.a('function');
}));
});
}); });