Skip to content

Commit

Permalink
fixed smoothStepEdge behaviour for sourceX > targetX for sourcePositi…
Browse files Browse the repository at this point in the history
…on === Position.Right && targetPosition === Position.Left case
  • Loading branch information
Ilya Moroz committed Jun 16, 2021
1 parent c956ac2 commit 87d518f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -7,4 +7,5 @@ cypress/screenshots
dist
.env
stats.html
.eslintcache
.eslintcache
.idea
6 changes: 6 additions & 0 deletions src/components/Edges/SmoothStepEdge.tsx
Expand Up @@ -73,6 +73,12 @@ export function getSmoothStepPath({
sourceY <= targetY ? rightTopCorner(cX, sourceY, cornerSize) : rightBottomCorner(cX, sourceY, cornerSize);
secondCornerPath =
sourceY <= targetY ? bottomLeftCorner(cX, targetY, cornerSize) : topLeftCorner(cX, targetY, cornerSize);
} else if (sourcePosition === Position.Right && targetPosition === Position.Left){
// and sourceX > targetX
firstCornerPath =
sourceY <= targetY ? leftTopCorner(cX, sourceY, cornerSize) : leftBottomCorner(cX, sourceY, cornerSize);
secondCornerPath =
sourceY <= targetY ? bottomRightCorner(cX, targetY, cornerSize) : topRightCorner(cX, targetY, cornerSize);
}
} else if (leftAndRight.includes(sourcePosition) && !leftAndRight.includes(targetPosition)) {
if (sourceX <= targetX) {
Expand Down

0 comments on commit 87d518f

Please sign in to comment.