Merge branch 'master' into develop

This commit is contained in:
Nico Rehwaldt
2019-08-21 09:53:30 +02:00
3 changed files with 143 additions and 6 deletions

View File

@ -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),