CustomAutoPlaceBehavior.js 944 Bytes
// import { getNewShapePosition } from 'bpmn-js/lib/features/auto-place/BpmnAutoPlaceUtil';
import { is } from 'bpmn-js/lib/util/ModelUtil';
import { isAny } from 'bpmn-js/lib/features/modeling/util/ModelingUtil';
import {
  getMid,
  asTRBL,
  getOrientation
} from 'diagram-js/lib/layout/LayoutUtil';

import {
  findFreePosition,
  generateGetNextPosition,
  getConnectedDistance
} from 'diagram-js/lib/features/auto-place/AutoPlaceUtil';


var HIGH_PRIORITY = 2500;


export default function AutoPlaceBehavior(eventBus, gridSnapping, toolManager, selection, modeling,
  bpmnFactory, elementRegistry) {
  // 消除移动到边界移动的bug
  eventBus.on('drag.move', HIGH_PRIORITY, function (context) {
  });
  // 移除原来的监听器
  eventBus._listeners["drag.move"].next = null;
}

AutoPlaceBehavior.$inject = [
  'eventBus',
  'gridSnapping',
  'toolManager',
  'selection',
  'modeling',
  'bpmnFactory',
  'elementRegistry'
];