I want the task node to be square, so I need to change the width of the element to do that.
But I looked for a long time for a way, and I couldn’t find it.
Can someone help me with this? Thank you very much.
Thank you, my problem is solved.
import ElementFactory from 'bpmn-js/lib/features/modeling/ElementFactory';
import defaultStyle from './defaultStyle'
import { merge } from 'min-dash';
import { is } from 'bpmn-js/lib/util/ModelUtil';
class CustomElementFactory extends ElementFactory {
constructor(bpmnFactory, moddle, translate, elementFactory) {
super(bpmnFactory, moddle, translate);
const backup_getDefaultSize = elementFactory.getDefaultSize;
elementFactory.getDefaultSize = (element, di) => {
if (is(element, 'bpmn:Task')) {
return { width: 50, height: 50};
}
return backup_getDefaultSize(element, di);
}
}
}
CustomElementFactory.$inject = [
'bpmnFactory',
'moddle',
'translate',
'elementFactory'
];
export default CustomElementFactory
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.