From 0a619a53fd610edace833817971956d4e0f63216 Mon Sep 17 00:00:00 2001 From: Nico Rehwaldt Date: Wed, 28 May 2014 23:19:41 +0200 Subject: [PATCH] fix(BpmnRenderer): minor drawing improvements This fix contributes these improvements * reset strokeWidth back to 1px for boundary + intermediate events * unify strokeDasharray for initiating start + cancelActivity boundary events * set dataObject fill to white --- lib/draw/BpmnRenderer.js | 52 +++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/lib/draw/BpmnRenderer.js b/lib/draw/BpmnRenderer.js index d9330482..6f3f12c3 100644 --- a/lib/draw/BpmnRenderer.js +++ b/lib/draw/BpmnRenderer.js @@ -340,7 +340,10 @@ function BpmnRenderer(events, styles, bpmnRegistry, pathMap) { var semantic = getSemantic(data); if (!semantic.isInterrupting) { - attrs = { strokeDasharray: '5,2' }; + attrs = { + strokeDasharray: '6', + strokeLinecap: 'round' + }; } var circle = renderer('bpmn:Event')(p, data, attrs); @@ -575,8 +578,8 @@ function BpmnRenderer(events, styles, bpmnRegistry, pathMap) { return circle; }, 'bpmn:IntermediateEvent': function(p, data) { - var outer = renderer('bpmn:Event')(p, data); - var inner = drawCircle(p, data.width, data.height, INNER_OUTER_DIST); + var outer = renderer('bpmn:Event')(p, data, { strokeWidth: 1 }); + var inner = drawCircle(p, data.width, data.height, INNER_OUTER_DIST, { strokeWidth: 1 }); renderEventContent(data, p); @@ -727,8 +730,8 @@ function BpmnRenderer(events, styles, bpmnRegistry, pathMap) { var task = renderer('bpmn:Task')(p, data); var pathData; - if (!!semantic.instantiate) { - drawCircle(p, 28, 28, 20 * 0.22); + if (semantic.instantiate) { + drawCircle(p, 28, 28, 20 * 0.22, { strokeWidth: 1 }); pathData = pathMap.getScaledPath('TASK_TYPE_INSTANTIATING_SEND', { abspos: { @@ -1006,16 +1009,16 @@ function BpmnRenderer(events, styles, bpmnRegistry, pathMap) { strokeWidth: 1, fill: 'none' }); - } else if((type === 'Exclusive') && instantiate) { + } else if (type === 'Exclusive') { - drawEvent(); - } else if((type === 'Exclusive') && !instantiate) { + if (!instantiate) { + var innerCircle = drawCircle(p, data.width, data.height, data.height * 0.26); + innerCircle.attr({ + strokeWidth: 1, + fill: 'none' + }); + } - var innerCircle = drawCircle(p, data.width, data.height, data.height * 0.26); - innerCircle.attr({ - strokeWidth: 1, - fill: 'none' - }); drawEvent(); } @@ -1023,10 +1026,7 @@ function BpmnRenderer(events, styles, bpmnRegistry, pathMap) { return diamond; }, 'bpmn:Gateway': function(p, data) { - - var diamond = drawDiamond(p, data.width, data.height); - - return diamond; + return drawDiamond(p, data.width, data.height); }, 'bpmn:SequenceFlow': function(p, data) { var pathData = createPathFromWaypoints(data.waypoints); @@ -1123,7 +1123,7 @@ function BpmnRenderer(events, styles, bpmnRegistry, pathMap) { } }); - var dataObject = drawPath(p, pathData); + var dataObject = drawPath(p, pathData, { fill: 'white' }); var semantic = getSemantic(data); @@ -1184,15 +1184,17 @@ function BpmnRenderer(events, styles, bpmnRegistry, pathMap) { var semantic = getSemantic(data), cancel = semantic.cancelActivity; - var outer = renderer('bpmn:Event')(p, data, cancel ? null : { + var attrs = { strokeLinecap: 'round', - strokeDasharray: '7,6' - }); + strokeWidth: 1 + }; - var inner = drawCircle(p, data.width, data.height, INNER_OUTER_DIST, cancel ? null : { - strokeLinecap: 'round', - strokeDasharray: '7,6' - }); + if (!cancel) { + attrs.strokeDasharray = '6'; + } + + var outer = renderer('bpmn:Event')(p, data, attrs); + var inner = drawCircle(p, data.width, data.height, INNER_OUTER_DIST, attrs); renderEventContent(data, p);