fix(modeling): update di bounds during shape.create

This commit is contained in:
Nico Rehwaldt 2014-08-02 16:38:25 +02:00
parent 4af334259c
commit 11f166a7f9
2 changed files with 10 additions and 3 deletions

View File

@ -57,8 +57,8 @@ function BpmnUpdater(eventBus, bpmnFactory, connectionDocking) {
self.updateBounds(e.context.shape); self.updateBounds(e.context.shape);
} }
this.executed([ 'shape.move' ], updateBounds); this.executed([ 'shape.move', 'shape.create' ], updateBounds);
this.reverted([ 'shape.move' ], updateBounds); this.reverted([ 'shape.move', 'shape.create' ], updateBounds);
// attach / detach connection // attach / detach connection
@ -108,7 +108,9 @@ BpmnUpdater.prototype.updateBounds = function(shape) {
_.extend(bounds, { _.extend(bounds, {
x: shape.x, x: shape.x,
y: shape.y y: shape.y,
width: shape.width,
height: shape.height
}); });
}; };

View File

@ -58,6 +58,11 @@ describe('features/modeling - append shape', function() {
// then // then
expect(target.di).toBeDefined(); expect(target.di).toBeDefined();
expect(target.di.$parent).toBe(startEvent.di.$parent); expect(target.di.$parent).toBe(startEvent.di.$parent);
expect(target.di.bounds.x).toBe(targetShape.x);
expect(target.di.bounds.y).toBe(targetShape.y);
expect(target.di.bounds.width).toBe(targetShape.width);
expect(target.di.bounds.height).toBe(targetShape.height);
})); }));