fix(draw): render labels as one-liner per default
This is a temporary fix for #113
This commit is contained in:
parent
8cc530bf58
commit
4428be4227
|
@ -281,7 +281,7 @@ function BpmnRenderer(events, styles, pathMap) {
|
||||||
|
|
||||||
function renderEmbeddedLabel(p, element, align) {
|
function renderEmbeddedLabel(p, element, align) {
|
||||||
var semantic = getSemantic(element);
|
var semantic = getSemantic(element);
|
||||||
return renderLabel(p, semantic.name, { box: element, align: align });
|
return renderLabel(p, semantic.name, { box: element, align: align, padding: 5 });
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderExternalLabel(p, element, align) {
|
function renderExternalLabel(p, element, align) {
|
||||||
|
@ -799,7 +799,7 @@ function BpmnRenderer(events, styles, pathMap) {
|
||||||
|
|
||||||
var expanded = DiUtil.isExpanded(semantic);
|
var expanded = DiUtil.isExpanded(semantic);
|
||||||
|
|
||||||
var isEventSubProcess = !!getSemantic(element).triggeredByEvent;
|
var isEventSubProcess = !!semantic.triggeredByEvent;
|
||||||
if (isEventSubProcess) {
|
if (isEventSubProcess) {
|
||||||
rect.attr({
|
rect.attr({
|
||||||
strokeDasharray: '1,2'
|
strokeDasharray: '1,2'
|
||||||
|
@ -1220,7 +1220,7 @@ function BpmnRenderer(events, styles, pathMap) {
|
||||||
drawPath(p, textPathData);
|
drawPath(p, textPathData);
|
||||||
|
|
||||||
var text = getSemantic(element).text || '';
|
var text = getSemantic(element).text || '';
|
||||||
renderLabel(p, text, { box: element, align: 'left-middle' });
|
renderLabel(p, text, { box: element, align: 'left-middle', padding: 5 });
|
||||||
|
|
||||||
return textElement;
|
return textElement;
|
||||||
},
|
},
|
||||||
|
|
|
@ -5,7 +5,7 @@ var _ = require('lodash');
|
||||||
|
|
||||||
var DEFAULT_LABEL_SIZE = module.exports.DEFAULT_LABEL_SIZE = {
|
var DEFAULT_LABEL_SIZE = module.exports.DEFAULT_LABEL_SIZE = {
|
||||||
width: 90,
|
width: 90,
|
||||||
height: 50
|
height: 20
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ var getExternalLabelMid = module.exports.getExternalLabelMid = function(element)
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
x: element.x + element.width / 2,
|
x: element.x + element.width / 2,
|
||||||
y: element.y + element.height + DEFAULT_LABEL_SIZE.height / 2 - 5
|
y: element.y + element.height + DEFAULT_LABEL_SIZE.height / 2
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -77,7 +77,7 @@ module.exports.getExternalLabelBounds = function(semantic, element) {
|
||||||
bounds = label.bounds;
|
bounds = label.bounds;
|
||||||
|
|
||||||
size = {
|
size = {
|
||||||
width: Math.max(150, bounds.width),
|
width: Math.max(DEFAULT_LABEL_SIZE.width, bounds.width),
|
||||||
height: bounds.height
|
height: bounds.height
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -109,7 +109,7 @@ describe('features/modeling - append shape', function() {
|
||||||
expect(elementRegistry.getById(label.id)).toBeDefined();
|
expect(elementRegistry.getById(label.id)).toBeDefined();
|
||||||
|
|
||||||
expect(label.x).toBe(443);
|
expect(label.x).toBe(443);
|
||||||
expect(label.y).toBe(273);
|
expect(label.y).toBe(278);
|
||||||
expect(label.width).toBe(LabelUtil.DEFAULT_LABEL_SIZE.width);
|
expect(label.width).toBe(LabelUtil.DEFAULT_LABEL_SIZE.width);
|
||||||
expect(label.height).toBe(LabelUtil.DEFAULT_LABEL_SIZE.height);
|
expect(label.height).toBe(LabelUtil.DEFAULT_LABEL_SIZE.height);
|
||||||
}));
|
}));
|
||||||
|
|
Loading…
Reference in New Issue