Revert "delay all label rendering"

This reverts commit 72c7c62f99c22a59d20d028c0abe1b358fda590c.
This commit is contained in:
Martin Stamm 2022-03-18 16:49:18 +01:00
parent ff387e5aad
commit 51fb2716cd

View File

@ -449,29 +449,27 @@ export default function BpmnRenderer(
return null; return null;
} }
async function renderLabel(parentGfx, label, options) { function renderLabel(parentGfx, label, options) {
return scheduler.schedule(() => { options = assign({
options = assign({ size: {
size: { width: 100
width: 100 }
} }, options);
}, 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); var semantic = getSemantic(element);
return await renderLabel(parentGfx, semantic.name, { return renderLabel(parentGfx, semantic.name, {
box: element, box: element,
align: align, align: align,
padding: 5, padding: 5,
@ -481,7 +479,7 @@ export default function BpmnRenderer(
}); });
} }
async function renderExternalLabel(parentGfx, element) { function renderExternalLabel(parentGfx, element) {
var box = { var box = {
width: 90, width: 90,
@ -490,7 +488,7 @@ export default function BpmnRenderer(
y: element.height / 2 + element.y y: element.height / 2 + element.y
}; };
return await renderLabel(parentGfx, getLabel(element), { return renderLabel(parentGfx, getLabel(element), {
box: box, box: box,
fitBox: true, fitBox: true,
style: assign( style: assign(
@ -503,8 +501,8 @@ export default function BpmnRenderer(
}); });
} }
async function renderLaneLabel(parentGfx, text, element) { function renderLaneLabel(parentGfx, text, element) {
var textBox = await renderLabel(parentGfx, text, { var textBox = renderLabel(parentGfx, text, {
box: { box: {
height: 30, height: 30,
width: element.height width: element.height
@ -1620,8 +1618,8 @@ export default function BpmnRenderer(
return group; return group;
}, },
'label': async function(parentGfx, element) { 'label': function(parentGfx, element) {
return await renderExternalLabel(parentGfx, element); return renderExternalLabel(parentGfx, element);
}, },
'bpmn:TextAnnotation': function(parentGfx, element) { 'bpmn:TextAnnotation': function(parentGfx, element) {
var style = { var style = {