feat(resize): add ability to resize shapes

see #140
This commit is contained in:
jdotzki 2014-10-10 09:06:21 +02:00
parent 4ab6c472df
commit 392dfaee41
3 changed files with 5 additions and 2 deletions

View File

@ -66,6 +66,7 @@ Modeler.prototype._modelingModules = [
require('bpmn-js-cli'),
require('diagram-js/lib/features/snapping'),
require('diagram-js/lib/features/move'),
require('diagram-js/lib/features/resize'),
require('./features/modeling'),
require('./features/context-pad'),
require('./features/palette')

View File

@ -65,8 +65,8 @@ function BpmnUpdater(eventBus, bpmnFactory, connectionDocking) {
self.updateBounds(e.context.shape);
}
this.executed([ 'shape.move', 'shape.create' ], updateBounds);
this.reverted([ 'shape.move', 'shape.create' ], updateBounds);
this.executed([ 'shape.move', 'shape.create', 'shape.resize' ], updateBounds);
this.reverted([ 'shape.move', 'shape.create', 'shape.resize' ], updateBounds);
// attach / detach connection

View File

@ -7,6 +7,7 @@ var BaseModeling = require('diagram-js/lib/features/modeling/Modeling');
var CreateShapeHandler = require('diagram-js/lib/features/modeling/cmd/CreateShapeHandler'),
DeleteShapeHandler = require('diagram-js/lib/features/modeling/cmd/DeleteShapeHandler'),
MoveShapeHandler = require('diagram-js/lib/features/modeling/cmd/MoveShapeHandler'),
ResizeShapeHandler = require('diagram-js/lib/features/modeling/cmd/ResizeShapeHandler'),
AppendShapeHandler = require('diagram-js/lib/features/modeling/cmd/AppendShapeHandler'),
@ -39,6 +40,7 @@ Modeling.prototype.registerHandlers = function(commandStack) {
commandStack.registerHandler('shape.create', CreateShapeHandler);
commandStack.registerHandler('shape.delete', DeleteShapeHandler);
commandStack.registerHandler('shape.move', MoveShapeHandler);
commandStack.registerHandler('shape.resize', ResizeShapeHandler);
commandStack.registerHandler('shape.append', AppendShapeHandler);