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
This commit is contained in:
Nico Rehwaldt 2014-05-28 23:19:41 +02:00
parent 281de42998
commit 0a619a53fd
1 changed files with 27 additions and 25 deletions

View File

@ -340,7 +340,10 @@ function BpmnRenderer(events, styles, bpmnRegistry, pathMap) {
var semantic = getSemantic(data); var semantic = getSemantic(data);
if (!semantic.isInterrupting) { if (!semantic.isInterrupting) {
attrs = { strokeDasharray: '5,2' }; attrs = {
strokeDasharray: '6',
strokeLinecap: 'round'
};
} }
var circle = renderer('bpmn:Event')(p, data, attrs); var circle = renderer('bpmn:Event')(p, data, attrs);
@ -575,8 +578,8 @@ function BpmnRenderer(events, styles, bpmnRegistry, pathMap) {
return circle; return circle;
}, },
'bpmn:IntermediateEvent': function(p, data) { 'bpmn:IntermediateEvent': function(p, data) {
var outer = renderer('bpmn:Event')(p, data); var outer = renderer('bpmn:Event')(p, data, { strokeWidth: 1 });
var inner = drawCircle(p, data.width, data.height, INNER_OUTER_DIST); var inner = drawCircle(p, data.width, data.height, INNER_OUTER_DIST, { strokeWidth: 1 });
renderEventContent(data, p); renderEventContent(data, p);
@ -727,8 +730,8 @@ function BpmnRenderer(events, styles, bpmnRegistry, pathMap) {
var task = renderer('bpmn:Task')(p, data); var task = renderer('bpmn:Task')(p, data);
var pathData; var pathData;
if (!!semantic.instantiate) { if (semantic.instantiate) {
drawCircle(p, 28, 28, 20 * 0.22); drawCircle(p, 28, 28, 20 * 0.22, { strokeWidth: 1 });
pathData = pathMap.getScaledPath('TASK_TYPE_INSTANTIATING_SEND', { pathData = pathMap.getScaledPath('TASK_TYPE_INSTANTIATING_SEND', {
abspos: { abspos: {
@ -1006,16 +1009,16 @@ function BpmnRenderer(events, styles, bpmnRegistry, pathMap) {
strokeWidth: 1, strokeWidth: 1,
fill: 'none' fill: 'none'
}); });
} else if((type === 'Exclusive') && instantiate) { } else if (type === 'Exclusive') {
drawEvent(); if (!instantiate) {
} else if((type === 'Exclusive') && !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(); drawEvent();
} }
@ -1023,10 +1026,7 @@ function BpmnRenderer(events, styles, bpmnRegistry, pathMap) {
return diamond; return diamond;
}, },
'bpmn:Gateway': function(p, data) { 'bpmn:Gateway': function(p, data) {
return drawDiamond(p, data.width, data.height);
var diamond = drawDiamond(p, data.width, data.height);
return diamond;
}, },
'bpmn:SequenceFlow': function(p, data) { 'bpmn:SequenceFlow': function(p, data) {
var pathData = createPathFromWaypoints(data.waypoints); 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); var semantic = getSemantic(data);
@ -1184,15 +1184,17 @@ function BpmnRenderer(events, styles, bpmnRegistry, pathMap) {
var semantic = getSemantic(data), var semantic = getSemantic(data),
cancel = semantic.cancelActivity; cancel = semantic.cancelActivity;
var outer = renderer('bpmn:Event')(p, data, cancel ? null : { var attrs = {
strokeLinecap: 'round', strokeLinecap: 'round',
strokeDasharray: '7,6' strokeWidth: 1
}); };
var inner = drawCircle(p, data.width, data.height, INNER_OUTER_DIST, cancel ? null : { if (!cancel) {
strokeLinecap: 'round', attrs.strokeDasharray = '6';
strokeDasharray: '7,6' }
});
var outer = renderer('bpmn:Event')(p, data, attrs);
var inner = drawCircle(p, data.width, data.height, INNER_OUTER_DIST, attrs);
renderEventContent(data, p); renderEventContent(data, p);