diff --git a/src/hooks/module/useTrestle.js b/src/hooks/module/useTrestle.js index 50d11cb9..4f0bb116 100644 --- a/src/hooks/module/useTrestle.js +++ b/src/hooks/module/useTrestle.js @@ -1662,11 +1662,11 @@ export const useTrestle = () => { break } case 'west': { - startPointX += 5 + startPointX -= 5 break } case 'north': { - startPointY += 5 + startPointY -= 5 break } } @@ -1686,14 +1686,15 @@ export const useTrestle = () => { }) canvas.add(bracket) canvas.renderAll() + const maxIntvl = Math.max(moduleIntvlHor, moduleIntvlVer) if (direction === 'south') { - startPointY -= height + moduleIntvlVer / 10 + startPointY -= height + maxIntvl / 10 } else if (direction === 'north') { - startPointY += height + moduleIntvlVer / 10 + startPointY += height + maxIntvl / 10 } else if (direction === 'east') { - startPointX -= width - moduleIntvlHor / 10 + startPointX -= width + maxIntvl / 10 } else if (direction === 'west') { - startPointX += width + moduleIntvlHor / 10 + startPointX += width + maxIntvl / 10 } } }