fix(step-edge): handle routes for same positions
This commit is contained in:
@@ -55,7 +55,6 @@
|
|||||||
key: deleteKeyString,
|
key: deleteKeyString,
|
||||||
modifier: deleteKeyModifier,
|
modifier: deleteKeyModifier,
|
||||||
callback: () => {
|
callback: () => {
|
||||||
console.log('delete');
|
|
||||||
deleteKeyPressed.set(true);
|
deleteKeyPressed.set(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,6 +57,13 @@
|
|||||||
style: 'border: 1px solid #777; padding: 10px',
|
style: 'border: 1px solid #777; padding: 10px',
|
||||||
position: { x: 250, y: 50 }
|
position: { x: 250, y: 50 }
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: '2a',
|
||||||
|
type: 'colorNode',
|
||||||
|
data: { onChange: onChange, color: $bgColor },
|
||||||
|
style: 'border: 1px solid #777; padding: 10px',
|
||||||
|
position: { x: 250, y: 520 }
|
||||||
|
},
|
||||||
{
|
{
|
||||||
id: '3',
|
id: '3',
|
||||||
type: 'output',
|
type: 'output',
|
||||||
|
|||||||
@@ -121,9 +121,9 @@ function getPoints({
|
|||||||
if (diff <= offset) {
|
if (diff <= offset) {
|
||||||
const gapOffset = Math.min(offset - 1, offset - diff);
|
const gapOffset = Math.min(offset - 1, offset - diff);
|
||||||
if (sourceDir[dirAccessor] === currDir) {
|
if (sourceDir[dirAccessor] === currDir) {
|
||||||
sourceGapOffset[dirAccessor] = gapOffset;
|
sourceGapOffset[dirAccessor] = (sourceGapped[dirAccessor] > source[dirAccessor] ? -1 : 1) * gapOffset;
|
||||||
} else {
|
} else {
|
||||||
targetGapOffset[dirAccessor] = gapOffset;
|
targetGapOffset[dirAccessor] = (targetGapped[dirAccessor] > target[dirAccessor] ? -1 : 1) * gapOffset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -143,8 +143,8 @@ function getPoints({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const sourceGapPoint = { x: sourceGapped.x - sourceGapOffset.x, y: sourceGapped.y - sourceGapOffset.y };
|
const sourceGapPoint = { x: sourceGapped.x + sourceGapOffset.x, y: sourceGapped.y + sourceGapOffset.y };
|
||||||
const targetGapPoint = { x: targetGapped.x - targetGapOffset.x, y: targetGapped.y - targetGapOffset.y };
|
const targetGapPoint = { x: targetGapped.x + targetGapOffset.x, y: targetGapped.y + targetGapOffset.y };
|
||||||
const maxXDistance = Math.max(Math.abs(sourceGapPoint.x - points[0].x), Math.abs(targetGapPoint.x - points[0].x));
|
const maxXDistance = Math.max(Math.abs(sourceGapPoint.x - points[0].x), Math.abs(targetGapPoint.x - points[0].x));
|
||||||
const maxYDistance = Math.max(Math.abs(sourceGapPoint.y - points[0].y), Math.abs(targetGapPoint.y - points[0].y));
|
const maxYDistance = Math.max(Math.abs(sourceGapPoint.y - points[0].y), Math.abs(targetGapPoint.y - points[0].y));
|
||||||
|
|
||||||
@@ -160,9 +160,9 @@ function getPoints({
|
|||||||
|
|
||||||
const pathPoints = [
|
const pathPoints = [
|
||||||
source,
|
source,
|
||||||
{ x: sourceGapped.x - sourceGapOffset.x, y: sourceGapped.y - sourceGapOffset.y },
|
{ x: sourceGapped.x + sourceGapOffset.x, y: sourceGapped.y + sourceGapOffset.y },
|
||||||
...points,
|
...points,
|
||||||
{ x: targetGapped.x - targetGapOffset.x, y: targetGapped.y - targetGapOffset.y },
|
{ x: targetGapped.x + targetGapOffset.x, y: targetGapped.y + targetGapOffset.y },
|
||||||
target,
|
target,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user