fixed smoothStepEdge behaviour for sourceX > targetX for sourcePosition === Position.Right && targetPosition === Position.Left case

This commit is contained in:
Ilya Moroz
2021-06-15 16:23:39 +03:00
parent c956ac2dd4
commit 87d518f8b5
2 changed files with 8 additions and 1 deletions

3
.gitignore vendored
View File

@@ -7,4 +7,5 @@ cypress/screenshots
dist
.env
stats.html
.eslintcache
.eslintcache
.idea

View File

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