mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-02 07:01:30 -08:00
fix looping behavior at close distance
This commit is contained in:
parent
4f7875ddb5
commit
bbbf800e3f
|
@ -16,6 +16,7 @@
|
|||
yOffset = params.yOffset || 0,
|
||||
lastx = null, lasty = null, lastOrientation,
|
||||
cornerRadius = params.cornerRadius != null ? params.cornerRadius : 0,
|
||||
loopbackMinimum = params.loopbackMinimum || 100,
|
||||
|
||||
// TODO now common between this and AbstractBezierEditor; refactor into superclass?
|
||||
loopbackRadius = params.loopbackRadius || 25,
|
||||
|
@ -199,8 +200,13 @@
|
|||
const direction = diffY > 0 ? 1 : -1;
|
||||
|
||||
var midx = paintInfo.startStubX + ((paintInfo.endStubX - paintInfo.startStubX) * midpoint),
|
||||
// midy = paintInfo.startStubY + ((paintInfo.endStubY - paintInfo.startStubY) * midpoint),
|
||||
midy;
|
||||
|
||||
if (diffX < (-1 * loopbackMinimum)) {
|
||||
midy = paintInfo.startStubY - (diffX < 0 ? direction * yOffset : 0);
|
||||
} else {
|
||||
midy = paintInfo.startStubY + ((paintInfo.endStubY - paintInfo.startStubY) * midpoint);
|
||||
}
|
||||
|
||||
if (diffX < 0 && diffX > (-1 * yOffset) && Math.abs(diffY) < yOffset) {
|
||||
midy = 0;
|
||||
|
|
|
@ -250,6 +250,7 @@ const getFlowChartType = (connection: Connection) => {
|
|||
gap: 5,
|
||||
alwaysRespectStubs: _ALWAYS_RESPECT_STUB,
|
||||
yOffset: NODE_SIZE + 5,
|
||||
loopbackMinimum: 150,
|
||||
}];
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue