From 99bed48fced729999c3270ee4e392197a94c24fe Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Wed, 17 Jul 2024 15:40:36 +0900 Subject: [PATCH] =?UTF-8?q?=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 | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/hooks/useMode.js b/src/hooks/useMode.js index 18282ed8..bc6cc381 100644 --- a/src/hooks/useMode.js +++ b/src/hooks/useMode.js @@ -229,22 +229,21 @@ export function useMode() { changeMode(canvas, Mode.EDIT) if (historyPoints.current.length >= 4) { - drawWallPolygon() + // handleOuterlinesTest() //외곽선 그리기 테스트 + // drawWallPolygon() //아래 내용 drawWallPolygon()으로 대체 - // const firstPoint = historyPoints.current[0] - // const lastPoint = historyPoints.current[historyPoints.current.length - 1] - // historyPoints.current.forEach((point) => { - // canvas?.remove(point) - // }) - // drawLineWithLength(lastPoint, firstPoint) - // points.current = [] - // historyPoints.current = [] + const firstPoint = historyPoints.current[0] + const lastPoint = historyPoints.current[historyPoints.current.length - 1] + historyPoints.current.forEach((point) => { + canvas?.remove(point) + }) + drawLineWithLength(lastPoint, firstPoint) + points.current = [] + historyPoints.current = [] - // // handleOuterlines() - // const wall = makePolygon() - // setWall(wall) - - handleOuterlinesTest() //외곽선 그리기 테스트 + handleOuterlinesTest() + const wall = makePolygon() + setWall(wall) } }