From 4ac1e6ea9a7e81a2ee7621eefe90aabcbb9b6867 Mon Sep 17 00:00:00 2001 From: yjnoh Date: Fri, 18 Oct 2024 14:01:19 +0900 Subject: [PATCH] =?UTF-8?q?=EC=98=A4=EA=B0=81=ED=98=95=20=EB=B0=B8?= =?UTF-8?q?=EB=A6=AC=EB=8D=B0=EC=9D=B4=EC=85=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/object/useObjectBatch.js | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/src/hooks/object/useObjectBatch.js b/src/hooks/object/useObjectBatch.js index 9ad8af5d..600dece7 100644 --- a/src/hooks/object/useObjectBatch.js +++ b/src/hooks/object/useObjectBatch.js @@ -471,32 +471,28 @@ export function useObjectBatch() { addCanvasMouseEventListener('mouse:up', (e) => { if (dormer) { - // const trianglePolygon = pointsToTurfPolygon(triangleToPolygon(dormer)) - // const selectedSurfacePolygon = polygonToTurfPolygon(selectedSurface) + const pentagonPolygon = pointsToTurfPolygon(dormer.points) + const selectedSurfacePolygon = polygonToTurfPolygon(selectedSurface) - // //지붕 밖으로 그렸을때 - // if (!turf.booleanWithin(trianglePolygon, selectedSurfacePolygon)) { - // swalFire({ text: '개구를 배치할 수 없습니다.', icon: 'error' }) - // //일단 지워 - // deleteTempObjects() - // return - // } + //지붕 밖으로 그렸을때 + if (!turf.booleanWithin(pentagonPolygon, selectedSurfacePolygon)) { + swalFire({ text: '개구를 배치할 수 없습니다.', icon: 'error' }) + //일단 지워 + deleteTempObjects() + return + } //각도 추가 - let originAngle = 0 //기본 남쪽 - let direction = 'south' + let direction = 'south' if (directionRef === 'left') { //서 - originAngle = 90 direction = 'west' } else if (directionRef === 'right') { //동 - originAngle = 270 direction = 'east' } else if (directionRef === 'up') { //북 - originAngle = 180 direction = 'north' }