mirror of
https://github.com/bpmn-io/bpmn-js.git
synced 2025-08-14 01:57:37 +08:00
23 lines
639 B
JavaScript
23 lines
639 B
JavaScript
import { getNewShapePosition } from './BpmnAutoPlaceUtil';
|
|
|
|
/**
|
|
* @typedef {import('diagram-js/lib/core/EventBus').default} EventBus
|
|
* @typedef {import('diagram-js/lib/core/ElementRegistry').default} ElementRegistry
|
|
*/
|
|
|
|
/**
|
|
* BPMN auto-place behavior.
|
|
*
|
|
* @param {EventBus} eventBus
|
|
* @param {ElementRegistry} elementRegistry
|
|
*/
|
|
export default function AutoPlace(eventBus, elementRegistry) {
|
|
eventBus.on('autoPlace', function(context) {
|
|
var shape = context.shape,
|
|
source = context.source;
|
|
|
|
return getNewShapePosition(source, shape, elementRegistry);
|
|
});
|
|
}
|
|
|
|
AutoPlace.$inject = [ 'eventBus', 'elementRegistry' ]; |