From e2ce94767ceededce0513351cb0d6b969d1a8067 Mon Sep 17 00:00:00 2001 From: yjnoh Date: Mon, 26 Aug 2024 16:23:15 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B2=84=ED=8A=BC=20=ED=81=B4=EB=A6=AD?= =?UTF-8?q?=EC=8B=9C=20=EC=98=A4=EB=A5=98=20validator?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useMode.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/hooks/useMode.js b/src/hooks/useMode.js index afb1f417..e624cf4b 100644 --- a/src/hooks/useMode.js +++ b/src/hooks/useMode.js @@ -1494,6 +1494,11 @@ export function useMode() { } const applyTemplateA = () => { + if (historyPoints.current.length === 0) { + changeMode(canvas, Mode.EDIT) + return + } + changeMode(canvas, Mode.EDIT) const polygon = drawWallPolygon(false) // handleClear() @@ -2940,7 +2945,11 @@ export function useMode() { * 템플릿 B 적용 */ const applyTemplateB = () => { - changeMode(canvas, Mode.EDIT) + if (historyPoints.current.length === 0) { + changeMode(canvas, Mode.EDIT) + return + } + const polygon = drawWallPolygon(false) const params = { eaves: 50, @@ -4218,8 +4227,6 @@ export function useMode() { } } - console.log('templateCenterLine', templateCenterLine) - if (templateCenterLine.length > 0) { //셀이 생성될 지붕의 흐름방향을 정함 templateCenterLine.some((centerLine) => {