chore(bpmn-js): adjust to diagram-js changes

Related to #151
This commit is contained in:
Nico Rehwaldt 2014-11-26 11:31:23 +01:00
parent 2f679a36b9
commit 1c6058e6cb
2 changed files with 11 additions and 13 deletions

View File

@ -135,8 +135,8 @@ Viewer.prototype.saveSVG = function(options, done) {
var canvas = this.get('canvas');
var contentNode = canvas.getLayer('base'),
defsNode = canvas._paper.select('defs');
var contentNode = canvas.getDefaultLayer(),
defsNode = canvas._svg.select('defs');
var contents = contentNode.innerSVG(),
defs = (defsNode && defsNode.outerSVG()) || '';

View File

@ -37,7 +37,7 @@ function BpmnRenderer(events, styles, pathMap) {
return markers[id];
}
function initMarkers(paper) {
function initMarkers(svg) {
function createMarker(id, options) {
var attrs = _.extend({
@ -70,13 +70,13 @@ function BpmnRenderer(events, styles, pathMap) {
createMarker('sequenceflow-end', {
element: paper.path('M 1 5 L 11 10 L 1 15 Z'),
element: svg.path('M 1 5 L 11 10 L 1 15 Z'),
ref: { x: 11, y: 10 },
scale: 0.5
});
createMarker('messageflow-start', {
element: paper.circle(6, 6, 5),
element: svg.circle(6, 6, 5),
attrs: {
fill: 'white',
stroke: 'black'
@ -85,7 +85,7 @@ function BpmnRenderer(events, styles, pathMap) {
});
createMarker('messageflow-end', {
element: paper.path('M 1 5 L 11 10 L 1 15 Z'),
element: svg.path('M 1 5 L 11 10 L 1 15 Z'),
attrs: {
fill: 'white',
stroke: 'black'
@ -94,7 +94,7 @@ function BpmnRenderer(events, styles, pathMap) {
});
createMarker('data-association-end', {
element: paper.path('M 1 5 L 11 10 L 1 15'),
element: svg.path('M 1 5 L 11 10 L 1 15'),
attrs: {
fill: 'white',
stroke: 'black'
@ -104,7 +104,7 @@ function BpmnRenderer(events, styles, pathMap) {
});
createMarker('conditional-flow-marker', {
element: paper.path('M 0 10 L 8 6 L 16 10 L 8 14 Z'),
element: svg.path('M 0 10 L 8 6 L 16 10 L 8 14 Z'),
attrs: {
fill: 'white',
stroke: 'black'
@ -114,7 +114,7 @@ function BpmnRenderer(events, styles, pathMap) {
});
createMarker('conditional-default-flow-marker', {
element: paper.path('M 1 4 L 5 16'),
element: svg.path('M 1 4 L 5 16'),
attrs: {
stroke: 'black'
},
@ -1493,11 +1493,9 @@ function BpmnRenderer(events, styles, pathMap) {
}
// hook onto canvas init event to initialize
// connection start/end markers on paper
// connection start/end markers on svg
events.on('canvas.init', function(event) {
var paper = event.paper;
initMarkers(paper);
initMarkers(event.svg);
});
this.drawShape = drawShape;