From 614aec95b76b40558ac75a082326b5c918af8e98 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Fri, 7 Feb 2025 11:53:43 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A7=80=EB=B6=95=EC=9E=AC=20=EC=98=A4?= =?UTF-8?q?=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/common.js | 1 + .../floor-plan/modal/setting01/FirstOption.jsx | 2 +- src/hooks/common/useRoofFn.js | 18 +++++++++++------- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/common/common.js b/src/common/common.js index 2578e138..ef09b31d 100644 --- a/src/common/common.js +++ b/src/common/common.js @@ -180,6 +180,7 @@ export const SAVE_KEY = [ 'directionText', 'quotationParam', 'pcses', + 'roofMaterial', ] export const OBJECT_PROTOTYPE = [fabric.Line.prototype, fabric.Polygon.prototype, fabric.Triangle.prototype] diff --git a/src/components/floor-plan/modal/setting01/FirstOption.jsx b/src/components/floor-plan/modal/setting01/FirstOption.jsx index fb383392..51a52cdb 100644 --- a/src/components/floor-plan/modal/setting01/FirstOption.jsx +++ b/src/components/floor-plan/modal/setting01/FirstOption.jsx @@ -44,7 +44,7 @@ export default function FirstOption(props) { const polygons = canvas?.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF) polygons.forEach((polygon) => { - setSurfaceShapePattern(polygon, item.column, false, polygon.roofMaterial, true) + setSurfaceShapePattern(polygon, item.column, false, polygon.roofMaterial, true, true) }) //디스플레이 설정 표시(단 건 선택) } else { diff --git a/src/hooks/common/useRoofFn.js b/src/hooks/common/useRoofFn.js index eaaebf0c..2b81ea05 100644 --- a/src/hooks/common/useRoofFn.js +++ b/src/hooks/common/useRoofFn.js @@ -20,19 +20,23 @@ export function useRoofFn() { const { addPitchText } = useLine() //면형상 선택 클릭시 지붕 패턴 입히기 - function setSurfaceShapePattern(polygon, mode = 'onlyBorder', trestleMode = false, roofMaterial = selectedRoofMaterial, isForceChange = false) { + function setSurfaceShapePattern( + polygon, + mode = 'onlyBorder', + trestleMode = false, + roofMaterial = selectedRoofMaterial, + isForceChange = false, + isDisplay = false, + ) { if (!polygon) { return } - if (isForceChange) { - if (polygon.roofMaterial) { + if (isForceChange && !isDisplay) { + /*if (polygon.roofMaterial) { polygon.roofMaterial = null - } + }*/ } - if (polygon.roofMaterial) { - return - } const ratio = window.devicePixelRatio || 1 const layout = roofMaterial.layout