From 1c6058e6cbac7d2c38f9d974182968da1c2cc132 Mon Sep 17 00:00:00 2001 From: Nico Rehwaldt Date: Wed, 26 Nov 2014 11:31:23 +0100 Subject: [PATCH] chore(bpmn-js): adjust to diagram-js changes Related to #151 --- lib/Viewer.js | 4 ++-- lib/draw/BpmnRenderer.js | 20 +++++++++----------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/lib/Viewer.js b/lib/Viewer.js index 19d1c652..83c39002 100644 --- a/lib/Viewer.js +++ b/lib/Viewer.js @@ -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()) || ''; diff --git a/lib/draw/BpmnRenderer.js b/lib/draw/BpmnRenderer.js index a8ee6783..f2ac03fa 100644 --- a/lib/draw/BpmnRenderer.js +++ b/lib/draw/BpmnRenderer.js @@ -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;