From 6c86b1181c05bc41d41666392014425c66c2f588 Mon Sep 17 00:00:00 2001 From: yjnoh Date: Wed, 4 Sep 2024 16:15:33 +0900 Subject: [PATCH] =?UTF-8?q?=EB=A9=B4=ED=98=95=EC=83=81=20=EA=B0=80?= =?UTF-8?q?=EB=8C=80=20=EB=B0=B0=EC=B9=98=EC=8B=9C=20=EC=9D=B4=EB=8F=99?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EC=9D=B8=ED=95=9C=20=EC=A2=8C=ED=91=9C=20?= =?UTF-8?q?=ED=8B=80=EC=96=B4=EC=A7=90=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useMode.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/hooks/useMode.js b/src/hooks/useMode.js index d4c5ece0..2c3efd8c 100644 --- a/src/hooks/useMode.js +++ b/src/hooks/useMode.js @@ -648,7 +648,7 @@ export function useMode() { } case 'Enter': { - const result = prompt('입력하세요 (a(A패턴),b(B패턴),t(지붕))') + const result = prompt('입력하세요 (a(A패턴), b(B패턴), t(지붕), e(변별))') switch (result) { case 'a': @@ -660,6 +660,8 @@ export function useMode() { case 't': templateMode() break + case 'e': + templateSideMode() } } } @@ -1051,6 +1053,18 @@ export function useMode() { setTemplateType(1) } } + + const templateSideMode = () => { + changeMode(canvas, Mode.EDIT) + + if (historyPoints.current.length >= 4) { + const wall = drawWallPolygon() + setWall(wall) + + console.log('sideWall', wall) + } + } + /** * 두 점을 연결하는 선과 길이를 그립니다. * a : 시작점, b : 끝점 @@ -4583,8 +4597,10 @@ export function useMode() { canvas?.off('mouse:move') canvas?.off('mouse:out') const roofs = canvas?.getObjects().filter((obj) => obj.name === 'roof') + roofs.forEach((roof, index) => { - const offsetPolygonPoint = offsetPolygon(roof.points, -20) + // const offsetPolygonPoint = offsetPolygon(roof.points(), -20) //이동되서 찍을라고 바꿈 + const offsetPolygonPoint = offsetPolygon(roof.getCurrentPoints(), -20) const trestlePoly = new QPolygon(offsetPolygonPoint, { fill: 'transparent',