fix(edges): connect from left to right with connection mode loose closes #1613
This commit is contained in:
@@ -52,6 +52,8 @@ export function getSmoothStepPath({
|
|||||||
const cX = typeof centerX !== 'undefined' ? centerX : _centerX;
|
const cX = typeof centerX !== 'undefined' ? centerX : _centerX;
|
||||||
const cY = typeof centerY !== 'undefined' ? centerY : _centerY;
|
const cY = typeof centerY !== 'undefined' ? centerY : _centerY;
|
||||||
|
|
||||||
|
console.log(sourcePosition, targetPosition);
|
||||||
|
|
||||||
let firstCornerPath = null;
|
let firstCornerPath = null;
|
||||||
let secondCornerPath = null;
|
let secondCornerPath = null;
|
||||||
|
|
||||||
@@ -73,8 +75,12 @@ export function getSmoothStepPath({
|
|||||||
sourceY <= targetY ? rightTopCorner(cX, sourceY, cornerSize) : rightBottomCorner(cX, sourceY, cornerSize);
|
sourceY <= targetY ? rightTopCorner(cX, sourceY, cornerSize) : rightBottomCorner(cX, sourceY, cornerSize);
|
||||||
secondCornerPath =
|
secondCornerPath =
|
||||||
sourceY <= targetY ? bottomLeftCorner(cX, targetY, cornerSize) : topLeftCorner(cX, targetY, cornerSize);
|
sourceY <= targetY ? bottomLeftCorner(cX, targetY, cornerSize) : topLeftCorner(cX, targetY, cornerSize);
|
||||||
} else if (sourcePosition === Position.Right && targetPosition === Position.Left){
|
} else if (
|
||||||
// and sourceX > targetX
|
(sourcePosition === Position.Right && targetPosition === Position.Left) ||
|
||||||
|
(sourcePosition === Position.Left && targetPosition === Position.Right) ||
|
||||||
|
(sourcePosition === Position.Left && targetPosition === Position.Left)
|
||||||
|
) {
|
||||||
|
// and sourceX > targetX
|
||||||
firstCornerPath =
|
firstCornerPath =
|
||||||
sourceY <= targetY ? leftTopCorner(cX, sourceY, cornerSize) : leftBottomCorner(cX, sourceY, cornerSize);
|
sourceY <= targetY ? leftTopCorner(cX, sourceY, cornerSize) : leftBottomCorner(cX, sourceY, cornerSize);
|
||||||
secondCornerPath =
|
secondCornerPath =
|
||||||
|
|||||||
Reference in New Issue
Block a user