From fbb1f352e9f8f7b686fa8a5f87d6c145ac4c18e9 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Thu, 8 Jan 2026 17:03:14 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B2=BD=20=EB=9D=BC=EC=9D=B8=20wallLine=20?= =?UTF-8?q?=EC=86=8D=EC=84=B1=20=EB=B3=80=EA=B2=BD=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../roofcover/useRoofAllocationSetting.js | 49 +++++-------------- 1 file changed, 13 insertions(+), 36 deletions(-) diff --git a/src/hooks/roofcover/useRoofAllocationSetting.js b/src/hooks/roofcover/useRoofAllocationSetting.js index 69479eef..70874765 100644 --- a/src/hooks/roofcover/useRoofAllocationSetting.js +++ b/src/hooks/roofcover/useRoofAllocationSetting.js @@ -323,42 +323,19 @@ export function useRoofAllocationSetting(id) { } const drawOriginRoofLine = () => { - // outerLinePoints 배열을 이용하여 빨간색 Line 객체들 생성 - if (outerLinePoints && outerLinePoints.length > 1) { - // 연속된 점들을 연결하여 라인 생성 - for (let i = 0; i < outerLinePoints.length - 1; i++) { - const point1 = outerLinePoints[i] - const point2 = outerLinePoints[i + 1] - - const line = new fabric.Line([point1.x, point1.y, point2.x, point2.y], { - stroke: 'black', - strokeDashArray: [5, 2], - strokeWidth: 1, - selectable: false, - name: 'originRoofOuterLine', - visible: outlineDisplay, - }) - - canvas.add(line) - } - - // 마지막 점과 첫 점을 연결하여 폐곡선 만들기 - if (outerLinePoints.length > 2) { - const lastPoint = outerLinePoints[outerLinePoints.length - 1] - const firstPoint = outerLinePoints[0] - - const closingLine = new fabric.Line([lastPoint.x, lastPoint.y, firstPoint.x, firstPoint.y], { - stroke: 'red', - strokeWidth: 2, - selectable: false, - name: 'originRoofOuterLine', - }) - - canvas.add(closingLine) - } - - canvas.renderAll() - } + const wallLines = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.WALL) + /** 벽면 삭제 */ + wallLines.forEach((wallLine) => { + wallLine.set({ + stroke: 'black', + strokeDashArray: [5, 2], + strokeWidth: 1, + selectable: false, + name: 'originRoofOuterLine', + visible: outlineDisplay, + }) + }) + canvas.renderAll() } /**