diff --git a/src/hooks/useMode.js b/src/hooks/useMode.js index 4df9698a..5666dabd 100644 --- a/src/hooks/useMode.js +++ b/src/hooks/useMode.js @@ -1542,6 +1542,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() @@ -2988,7 +2993,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, @@ -4266,8 +4275,6 @@ export function useMode() { } } - console.log('templateCenterLine', templateCenterLine) - if (templateCenterLine.length > 0) { //셀이 생성될 지붕의 흐름방향을 정함 templateCenterLine.some((centerLine) => {