From 22ca59e9b9538741f722ee82fc9fb73b0320d089 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Thu, 13 Mar 2025 13:26:32 +0900 Subject: [PATCH] =?UTF-8?q?=EB=9E=99=EC=97=86=EC=9D=8C=EC=9D=98=20?= =?UTF-8?q?=EA=B2=BD=EC=9A=B0=20=EC=A7=80=EC=A7=80=EA=B8=88=EA=B5=AC=20?= =?UTF-8?q?=EC=84=A4=EC=B9=98=20=EC=A2=8C=ED=91=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/module/useTrestle.js | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) 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') {