chore(modeling): set minimum height to one line

Closes #402
This commit is contained in:
hoferch91 2016-03-03 17:51:07 +01:00 committed by Nico Rehwaldt
parent 4b941bf7cc
commit 0393d51893
5 changed files with 23 additions and 6 deletions

View File

@ -155,6 +155,10 @@ ElementFactory.prototype._getDefaultSize = function(semantic) {
return { width: 50, height: 50 }; return { width: 50, height: 50 };
} }
if (is(semantic, 'bpmn:TextAnnotation')) {
return { width: 100, height: 30 };
}
return { width: 100, height: 80 }; return { width: 100, height: 80 };
}; };

View File

@ -234,7 +234,7 @@ function BpmnSnapping(eventBus, canvas, bpmnRules, elementRegistry) {
} }
if (is(shape, 'bpmn:TextAnnotation')) { if (is(shape, 'bpmn:TextAnnotation')) {
context.minDimensions = { width: 50, height: 50 }; context.minDimensions = { width: 50, height: 30 };
} }
}); });

View File

@ -85,9 +85,22 @@ describe('features/modeling - append text-annotation', function() {
expect(connecting.$parent.id).to.equal('Transaction_2'); expect(connecting.$parent.id).to.equal('Transaction_2');
})); }));
it('with right size', inject(function(elementRegistry, elementFactory, modeling) {
//given
var eventShape = elementRegistry.get('IntermediateCatchEvent_1');
//when
var annotationShape = modeling.appendShape(eventShape, { type: 'bpmn:TextAnnotation' });
//then
expect(annotationShape.width).to.eql(100);
expect(annotationShape.height).to.eql(30);
}));
}); });
describe('undo', function() { describe('undo', function() {
it('should undo wire connection source + target', inject(function(elementRegistry, modeling, commandStack) { it('should undo wire connection source + target', inject(function(elementRegistry, modeling, commandStack) {

View File

@ -35,7 +35,7 @@ describe('features/modeling - layout association', function() {
// then // then
expect(waypoints).to.eql([ expect(waypoints).to.eql([
{ original: { x: 400, y: 400 }, x: 370, y: 360 }, { original: { x: 400, y: 400 }, x: 389, y: 385 },
{ original: { x: 191, y: 120 }, x: 202, y: 134 } { original: { x: 191, y: 120 }, x: 202, y: 134 }
]); ]);
@ -57,7 +57,7 @@ describe('features/modeling - layout association', function() {
// then // then
expect(waypoints).to.eql([ expect(waypoints).to.eql([
{ original: { x: 420, y: 400 }, x: 387, y: 360 }, { original: { x: 420, y: 400 }, x: 408, y: 385 },
{ original: { x: 191, y: 120 }, x: 202, y: 134 } { original: { x: 191, y: 120 }, x: 202, y: 134 }
]); ]);
@ -85,7 +85,7 @@ describe('features/modeling - layout association', function() {
// then // then
expect(waypoints).to.eql([ expect(waypoints).to.eql([
{ original: { x: 420, y: 400 }, x: 412, y: 360 }, { original: { x: 420, y: 400 }, x: 417, y: 385 },
{ x: 400, y: 300 }, { x: 400, y: 300 },
{ original: { x: 191, y: 120 }, x: 204, y: 131 } { original: { x: 191, y: 120 }, x: 204, y: 131 }
]); ]);

View File

@ -416,7 +416,7 @@ describe('features/snapping - BpmnSnapping', function() {
dragging.end(); dragging.end();
expect(textAnnotation.width).to.equal(50); expect(textAnnotation.width).to.equal(50);
expect(textAnnotation.height).to.equal(50); expect(textAnnotation.height).to.equal(30);
})); }));
}); });