mirror of
https://github.com/sartography/bpmn-js.git
synced 2025-01-09 16:45:49 +00:00
3b756e0725
Related to camunda/camunda-modeler#1344
25 lines
599 B
JavaScript
25 lines
599 B
JavaScript
import { isAny } from '../modeling/util/ModelingUtil';
|
|
|
|
export default function BpmnGridSnapping(eventBus) {
|
|
eventBus.on([
|
|
'create.init',
|
|
'shape.move.init'
|
|
], function(event) {
|
|
var context = event.context,
|
|
shape = event.shape;
|
|
|
|
if (isAny(shape, [
|
|
'bpmn:Participant',
|
|
'bpmn:SubProcess',
|
|
'bpmn:TextAnnotation'
|
|
])) {
|
|
if (!context.gridSnappingContext) {
|
|
context.gridSnappingContext = {};
|
|
}
|
|
|
|
context.gridSnappingContext.snapLocation = 'top-left';
|
|
}
|
|
});
|
|
}
|
|
|
|
BpmnGridSnapping.$inject = [ 'eventBus' ]; |