mirror of
https://github.com/bpmn-io/bpmn-js.git
synced 2025-08-06 18:24:33 +08:00
24 lines
625 B
JavaScript
24 lines
625 B
JavaScript
import { getOrientation } from 'diagram-js/lib/layout/LayoutUtil';
|
|
|
|
/**
|
|
* @typedef {import('diagram-js/lib/util/Types').DirectionTRBL} DirectionTRBL
|
|
* @typedef {import('diagram-js/lib/util/Types').Point} Point
|
|
* @typedef {import('diagram-js/lib/util/Types').Rect} Rect
|
|
*/
|
|
|
|
/**
|
|
* @param {Point} position
|
|
* @param {Rect} targetBounds
|
|
*
|
|
* @return {DirectionTRBL|null}
|
|
*/
|
|
export function getBoundaryAttachment(position, targetBounds) {
|
|
|
|
var orientation = getOrientation(position, targetBounds, -15);
|
|
|
|
if (orientation !== 'intersect') {
|
|
return orientation;
|
|
} else {
|
|
return null;
|
|
}
|
|
} |