From 6458b508947a8ea3d3376b4babf3122fe300b6d7 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Fri, 9 Aug 2024 16:50:32 +0900 Subject: [PATCH] =?UTF-8?q?=EB=AA=A8=EC=9E=84=EC=A7=80=EB=B6=95=20selectab?= =?UTF-8?q?le=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useMode.js | 8 ++++++-- src/util/qpolygon-utils.js | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/hooks/useMode.js b/src/hooks/useMode.js index 72f45c9e..c6c3552b 100644 --- a/src/hooks/useMode.js +++ b/src/hooks/useMode.js @@ -4480,7 +4480,7 @@ export function useMode() { stroke: 'red', strokeDashArray: [5, 5], strokeWidth: 1, - selectable: true, + selectable: false, fontSize: fontSize, name: 'trestle', lockMovementX: true, // X 축 이동 잠금 @@ -4504,9 +4504,10 @@ export function useMode() { const notSelectedTrestlePolygons = canvas?.getObjects().filter((obj) => obj.name === 'trestle' && !obj.selected) if (trestlePolygons.length === 0) { alert('가대가 없습니다.') + return } - if (notSelectedTrestlePolygons.length > 0) { + if (drewRoofCells.length > 0) { alert('기존 셀은 제거됩니다.') } @@ -4531,7 +4532,10 @@ export function useMode() { drawRoofCells = trestle.fillCell({ width: 100, height: 50, padding: 0 }) trestle.direction = 'east' } + drawCellsArray.push(drawRoofCells) }) + + setDrewRoofCells(drawCellsArray) } // 외적을 계산하는 함수 diff --git a/src/util/qpolygon-utils.js b/src/util/qpolygon-utils.js index f6162e54..5a216524 100644 --- a/src/util/qpolygon-utils.js +++ b/src/util/qpolygon-utils.js @@ -1134,6 +1134,7 @@ export const splitPolygonWithLines = (polygon) => { fill: 'transparent', strokeWidth: 3, name: 'roof', + selectable: false, }) polygon.canvas.add(roof)