fix(draw/labels): adjust font-size and no-di positioning
This commit is contained in:
parent
70778082b5
commit
7540186f6e
|
@ -22,8 +22,8 @@ function BpmnRenderer(events, styles, bpmnRegistry, pathMap) {
|
|||
var INNER_OUTER_DIST = 3;
|
||||
|
||||
var LABEL_STYLE = {
|
||||
fontFamily: '"Helvetica Neue", Helvetica, Arial, sans-serif',
|
||||
fontSize: '10pt'
|
||||
fontFamily: 'Arial, sans-serif',
|
||||
fontSize: '12px'
|
||||
};
|
||||
|
||||
var labelUtil = new LabelUtil({
|
||||
|
@ -261,31 +261,27 @@ function BpmnRenderer(events, styles, bpmnRegistry, pathMap) {
|
|||
return null;
|
||||
}
|
||||
|
||||
function renderLabel(p, label, box, align) {
|
||||
return labelUtil.createLabel(p, label || '', { box: box, align: align }).addClass('djs-label');
|
||||
function renderLabel(p, label, options) {
|
||||
return labelUtil.createLabel(p, label || '', options).addClass('djs-label');
|
||||
}
|
||||
|
||||
function renderEmbeddedLabel(p, data, align) {
|
||||
var element = bpmnRegistry.getSemantic(data);
|
||||
|
||||
return renderLabel(p, element.name, data, align);
|
||||
return renderLabel(p, element.name, { box: data, align: align });
|
||||
}
|
||||
|
||||
function renderExternalLabel(p, data, align) {
|
||||
var element = bpmnRegistry.getSemantic(data.attachedId);
|
||||
return renderLabel(p, element.name, data, align);
|
||||
return renderLabel(p, element.name, { box: data, align: align, style: { fontSize: '11px' } });
|
||||
}
|
||||
|
||||
function renderLaneLabel(p, text, data) {
|
||||
var textBox = renderLabel(
|
||||
p,
|
||||
text,
|
||||
{
|
||||
height: 30,
|
||||
width: data.height
|
||||
},
|
||||
'center-middle'
|
||||
);
|
||||
var textBox = renderLabel(p, text, {
|
||||
box: { height: 30, width: data.height },
|
||||
align: 'center-middle'
|
||||
});
|
||||
|
||||
var bbox = textBox.getBBox();
|
||||
var top = -1 * data.height;
|
||||
textBox.transform(
|
||||
|
@ -654,7 +650,7 @@ function BpmnRenderer(events, styles, bpmnRegistry, pathMap) {
|
|||
} else {
|
||||
// Collapsed pool draw text inline
|
||||
var text2 = bpmnRegistry.getSemantic(data.id).name;
|
||||
renderLabel(p, text2, data, 'center-middle');
|
||||
renderLabel(p, text2, { box: data, align: 'center-middle' });
|
||||
}
|
||||
|
||||
return lane;
|
||||
|
@ -981,7 +977,7 @@ function BpmnRenderer(events, styles, bpmnRegistry, pathMap) {
|
|||
var textPath = drawPath(p, textPathData);
|
||||
|
||||
var text = bpmnRegistry.getSemantic(data.id).text || '';
|
||||
var label = renderLabel(p, text, data, 'left-middle');
|
||||
var label = renderLabel(p, text, { box: data, align: 'left-middle' });
|
||||
|
||||
return label;
|
||||
}
|
||||
|
|
|
@ -53,12 +53,12 @@ function getLabelBounds(di, data) {
|
|||
} else {
|
||||
mid = {
|
||||
x: data.x + data.width / 2,
|
||||
y: data.y + data.height + 5
|
||||
y: data.y + data.height - 5
|
||||
};
|
||||
}
|
||||
|
||||
size = {
|
||||
width: 150,
|
||||
width: 90,
|
||||
height: 50
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue