mirror of
https://github.com/bpmn-io/bpmn-js.git
synced 2025-08-26 04:32:44 +08:00
Merge branch 'master' into develop
This commit is contained in:
@ -81,7 +81,7 @@ BpmnLayouter.prototype.layoutConnection = function(connection, hints) {
|
||||
|
||||
if (source === target) {
|
||||
manhattanOptions = {
|
||||
preferredLayouts: [ 'b:l' ]
|
||||
preferredLayouts: getLoopPreferredLayout(source, connection)
|
||||
};
|
||||
} else
|
||||
|
||||
@ -264,6 +264,22 @@ function isHorizontalOrientation(orientation) {
|
||||
return orientation === 'right' || orientation === 'left';
|
||||
}
|
||||
|
||||
function getLoopPreferredLayout(source, connection) {
|
||||
var waypoints = connection.waypoints;
|
||||
|
||||
var orientation = waypoints && waypoints.length && getOrientation(waypoints[0], source);
|
||||
|
||||
if (orientation === 'top') {
|
||||
return [ 't:r' ];
|
||||
} else if (orientation === 'right') {
|
||||
return [ 'r:b' ];
|
||||
} else if (orientation === 'left') {
|
||||
return [ 'l:t' ];
|
||||
}
|
||||
|
||||
return [ 'b:l' ];
|
||||
}
|
||||
|
||||
function getBoundaryEventPreferredLayouts(source, target, end) {
|
||||
var sourceMid = getMid(source),
|
||||
targetMid = getMid(target),
|
||||
|
Reference in New Issue
Block a user