From 6527e7d116e6999b1cbcc8d5db46121a378c14f6 Mon Sep 17 00:00:00 2001 From: Nico Rehwaldt Date: Mon, 25 Nov 2019 15:05:04 +0100 Subject: [PATCH] fix(draw): render colored BPMN group elements Related to https://github.com/camunda/camunda-modeler/issues/1598 --- lib/draw/BpmnRenderer.js | 1 + test/spec/draw/BpmnRenderer.group-colors.bpmn | 19 +++++++++++++++++++ test/spec/draw/BpmnRendererSpec.js | 6 ++++++ 3 files changed, 26 insertions(+) create mode 100644 test/spec/draw/BpmnRenderer.group-colors.bpmn diff --git a/lib/draw/BpmnRenderer.js b/lib/draw/BpmnRenderer.js index 43868e44..c8689fd5 100644 --- a/lib/draw/BpmnRenderer.js +++ b/lib/draw/BpmnRenderer.js @@ -1588,6 +1588,7 @@ export default function BpmnRenderer( 'bpmn:Group': function(parentGfx, element) { var group = drawRect(parentGfx, element.width, element.height, TASK_BORDER_RADIUS, { + stroke: getStrokeColor(element, defaultStrokeColor), strokeWidth: 1, strokeDasharray: '8,3,1,3', fill: 'none', diff --git a/test/spec/draw/BpmnRenderer.group-colors.bpmn b/test/spec/draw/BpmnRenderer.group-colors.bpmn new file mode 100644 index 00000000..76c327dd --- /dev/null +++ b/test/spec/draw/BpmnRenderer.group-colors.bpmn @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/test/spec/draw/BpmnRendererSpec.js b/test/spec/draw/BpmnRendererSpec.js index 26425bc1..46d50c25 100644 --- a/test/spec/draw/BpmnRendererSpec.js +++ b/test/spec/draw/BpmnRendererSpec.js @@ -326,12 +326,18 @@ describe('draw - bpmn renderer', function() { var xml = require('./BpmnRenderer.colors.bpmn'); + var groupXML = require('./BpmnRenderer.group-colors.bpmn'); it('should render colors without warnings and errors', function(done) { bootstrapViewer(xml).call(this, checkErrors(done)); }); + it('should render group colors', function(done) { + bootstrapViewer(groupXML).call(this, checkErrors(done)); + }); + + describe('default colors', function() { var defaultFillColor = 'red',