fix(draw): only apply fillOpacity on actual fill

This corrects some SVG to image issues.

Addresses camunda/camunda-modeler#764
This commit is contained in:
Nico Rehwaldt 2018-04-09 13:02:40 +02:00
parent e159b002cd
commit a77d44455f

View File

@ -265,6 +265,10 @@ export default function BpmnRenderer(
fill: 'white' fill: 'white'
}); });
if (attrs.fill === 'none') {
delete attrs.fillOpacity;
}
var cx = width / 2, var cx = width / 2,
cy = height / 2; cy = height / 2;
@ -1532,8 +1536,7 @@ export default function BpmnRenderer(
var attrs = { var attrs = {
strokeWidth: 1, strokeWidth: 1,
fill: getFillColor(element), fill: getFillColor(element),
stroke: getStrokeColor(element), stroke: getStrokeColor(element)
fillOpacity: 1
}; };
if (!cancel) { if (!cancel) {
@ -1541,8 +1544,19 @@ export default function BpmnRenderer(
attrs.strokeLinecap = 'round'; attrs.strokeLinecap = 'round';
} }
var outer = renderer('bpmn:Event')(parentGfx, element, attrs); // apply fillOpacity
/* inner path */ drawCircle(parentGfx, element.width, element.height, INNER_OUTER_DIST, assign(attrs, { fill: 'none' })); var outerAttrs = assign({}, attrs, {
fillOpacity: 1
});
// apply no-fill
var innerAttrs = assign({}, attrs, {
fill: 'none'
});
var outer = renderer('bpmn:Event')(parentGfx, element, outerAttrs);
/* inner path */ drawCircle(parentGfx, element.width, element.height, INNER_OUTER_DIST, innerAttrs);
renderEventContent(element, parentGfx); renderEventContent(element, parentGfx);