diff --git a/src/hooks/module/useTrestle.js b/src/hooks/module/useTrestle.js index 3e6adaab..2c9e43ad 100644 --- a/src/hooks/module/useTrestle.js +++ b/src/hooks/module/useTrestle.js @@ -873,7 +873,7 @@ export const useTrestle = () => { } case 'east': { widthArr.forEach((w) => { - topRightPoint = { x: x + w, y: y + height / 2 } + topRightPoint = { x: x - w, y: y - height / 2 } if (result) return result = centerPoints.find( (centerPoint) => Math.abs(centerPoint.x - topRightPoint.x) < maxX && Math.abs(centerPoint.y - topRightPoint.y) < maxY, @@ -883,7 +883,7 @@ export const useTrestle = () => { } case 'west': { widthArr.forEach((w) => { - topRightPoint = { x: x - w, y: y - height / 2 } + topRightPoint = { x: x + w, y: y + height / 2 } if (result) return result = centerPoints.find( (centerPoint) => Math.abs(centerPoint.x - topRightPoint.x) < maxX && Math.abs(centerPoint.y - topRightPoint.y) < maxY,