From 51fb2716cd4b2ba55d90e287b36197f6631fc801 Mon Sep 17 00:00:00 2001 From: Martin Stamm Date: Fri, 18 Mar 2022 16:49:18 +0100 Subject: [PATCH] Revert "delay all label rendering" This reverts commit 72c7c62f99c22a59d20d028c0abe1b358fda590c. --- lib/draw/BpmnRenderer.js | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/lib/draw/BpmnRenderer.js b/lib/draw/BpmnRenderer.js index 38ae3bab..86378146 100644 --- a/lib/draw/BpmnRenderer.js +++ b/lib/draw/BpmnRenderer.js @@ -449,29 +449,27 @@ export default function BpmnRenderer( return null; } - async function renderLabel(parentGfx, label, options) { + function renderLabel(parentGfx, label, options) { - return scheduler.schedule(() => { - options = assign({ - size: { - width: 100 - } - }, options); + options = assign({ + size: { + width: 100 + } + }, options); - var text = textRenderer.createText(label || '', options); + var text = textRenderer.createText(label || '', options); - svgClasses(text).add('djs-label'); + svgClasses(text).add('djs-label'); - svgAppend(parentGfx, text); + svgAppend(parentGfx, text); - return text; - }); + return text; } - async function renderEmbeddedLabel(parentGfx, element, align) { + function renderEmbeddedLabel(parentGfx, element, align) { var semantic = getSemantic(element); - return await renderLabel(parentGfx, semantic.name, { + return renderLabel(parentGfx, semantic.name, { box: element, align: align, padding: 5, @@ -481,7 +479,7 @@ export default function BpmnRenderer( }); } - async function renderExternalLabel(parentGfx, element) { + function renderExternalLabel(parentGfx, element) { var box = { width: 90, @@ -490,7 +488,7 @@ export default function BpmnRenderer( y: element.height / 2 + element.y }; - return await renderLabel(parentGfx, getLabel(element), { + return renderLabel(parentGfx, getLabel(element), { box: box, fitBox: true, style: assign( @@ -503,8 +501,8 @@ export default function BpmnRenderer( }); } - async function renderLaneLabel(parentGfx, text, element) { - var textBox = await renderLabel(parentGfx, text, { + function renderLaneLabel(parentGfx, text, element) { + var textBox = renderLabel(parentGfx, text, { box: { height: 30, width: element.height @@ -1620,8 +1618,8 @@ export default function BpmnRenderer( return group; }, - 'label': async function(parentGfx, element) { - return await renderExternalLabel(parentGfx, element); + 'label': function(parentGfx, element) { + return renderExternalLabel(parentGfx, element); }, 'bpmn:TextAnnotation': function(parentGfx, element) { var style = {