CustomAutoPlaceBehavior.js
944 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// 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'
];