diff --git a/src/hooks/module/useTrestle.js b/src/hooks/module/useTrestle.js index 3ef6d335..50d11cb9 100644 --- a/src/hooks/module/useTrestle.js +++ b/src/hooks/module/useTrestle.js @@ -1652,10 +1652,29 @@ export const useTrestle = () => { } } + switch (direction) { + case 'south': { + startPointY -= 5 + break + } + case 'east': { + startPointX -= 5 + break + } + case 'west': { + startPointX += 5 + break + } + case 'north': { + startPointY += 5 + break + } + } + for (let i = 0; i < count; i++) { const bracket = new fabric.Rect({ - left: startPointX - 5, - top: startPointY - 5, + left: startPointX, + top: startPointY, fill: 'green', name: TRESTLE_MATERIAL.BRACKET, parentId: module.id, @@ -1668,7 +1687,7 @@ export const useTrestle = () => { canvas.add(bracket) canvas.renderAll() if (direction === 'south') { - startPointY -= height - moduleIntvlVer / 10 + startPointY -= height + moduleIntvlVer / 10 } else if (direction === 'north') { startPointY += height + moduleIntvlVer / 10 } else if (direction === 'east') {