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' }