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